When you inhale tobacco smoke, the respiratory system tries to protect itself by producing mucus and coughing. Normally, the cilia (tiny hairlike structures) beat outward to sweep harmful substances out of the lungs. Smoking retards this sweeping action, so some of the toxins remain in the lungs and mucus remains in the airways. When you sleep, some cilia recover and start functioning again. On waking, you cough because your lungs are trying to get rid of the toxins from the previous day’s smoking. Eventually, after long-term exposure to tobacco smoke, the cilia stop functioning completely.
Smokers want help when quitting