Biologically, the accumulation of mucus is a reflex designed to attack viruses or sicknesses, but I'm pretty sure you need as much as it gives you. You can probably get rid of some by following imayeon's recommendations (or, if you really wanted to, sleep with your nose facing down, but that's kinda disgusting, you totally don't have to). Coughing is also a deterrent to sicknesses and other stuff that's not supposed to be in your lungs anyway, you can't do much about that, but it's a very useful reflex, so try not to limit it unless it feels like it's hurting you.