If you find yourself coughing while singing, you'll want to quell it right away. Coughing strains your vocal folds, makes singing difficult (or even impossible), and distracts the listener from your performance.
To put a stop to your cough, you'll need to determine what's causing it. Your voice is your instrument, and it's irreplaceable, so make sure to give it the care it deserves.
If you're coughing because you have a common cold, bronchitis, or another kind of respiratory tract infection, stop singing immediately. Rest your voice until you're well again, and be sure to stay hydrated as you heal. If you experience a lingering sore throat or cough, see your family doctor or an ear, nose and throat specialist before you begin singing again.
If you're not sick, you may be coughing due to dryness or irritation. Keep hydrated by drinking water or electrolyte-rich beverages regularly throughout the day and take a few sips between scales, exercises and songs as you practice. Use humidifiers to keep the air in your home and workspace moist, and minimize the amount of time you spend in air-conditioned rooms.
Make sure your living space and work environment are as dust- and allergen-free as possible. Furthermore, don't smoke or use tobacco products before an important audition or performance--or ever; the effects of tobacco on the human voice can be devastating.
You may be coughing due to the way you're using your voice. If you're not employing proper breath support, over-singing (or "pushing"), and/or practicing music that is inappropriate for your voice type, you could be straining and damaging your vocal cords. It is important to work with an experienced instructor who will teach you to support your sound, identify and correct any harmful vocal habits you've developed, and assign repertoire that is appropriate for your voice type, age, and technical ability.
If you experience a random fit of coughing while singing with healthy technique, take a short break to drink some water, and allow yourself to yawn deeply. Swallowing and yawning both help the larynx to return to a neutral position.
Avoid straining your voice whenever possible. Minimize the amount of time you spend talking at top volume or shouting across the room. If your job requires you to spend a good portion of the day talking, ask your voice teacher to demonstrate healthy speaking techniques.