I agree with tesorotiffa: productive cough is "welcome", while for unproductive cough (which just irritates you) I usually drink water and get a cough drop.
Side note: early on I was told "cough is your best friend" and encouraged to cough. Now in Spain the trend is to go with Autogenic Drainage, in which you DON'T cough! Or at least very, very little. The idea is to cause as less damage to the lungs, so if you have to cough, do it with very low volume of air. And for the exercises, the breathing technique is developed to "breath up" the mucus until it's high up enough that you can just HARKLE it out!
I never realized that filling up your lungs with air and then coughing causes a lot of damage to the airways...
For grown-ups, it really hard to get used to not coughing at all but you can make it, and at least you can certainly reduce or eliminate those violent coughing fits. Children learn it really easy, it's fantastic.
Try to check it out! I don't know how extended it is in the States, and it's crucial to get proper training because otherwise it just doesn't work. Here we're lucky because Mr. Chevailler, the founder, came to teach.