If you are coughing to the point you cannot sleep, and over the counter cough syrup does not help, PLEASE go to the doctor! Chances are you have an infection.....next you will not be able to hold down liquids or food.
The key IS if you cannot sleep. You NEED rest and if the cough keeps you awake, get your butt to the Doc!
I've been in the hospital because I did not follow this advice. That was a long time ago. Probably about your age and drove myself to that point because I did not take it seriously. That wasn't any fun at all.