What do I do with an infected toenail?

I have an infected toenail that I keep draining and I don’t know what I’m supposed to do about it. Do I go to the doctor for this? I figured once I cut the nail and drained it that it would heal up but it’s ooZing and hurts really bad.