Coughing is one of the body's defense mechanisms of getting rid of phlegm, mucus, sputum, postnasal drip, or a foreign body.