This is a protective reflex to remove an obstruction or irritant from the respiratory organs.
From a herbalist point of view it is important not to suppress but to encourage elimination.
A nervous cough can be helped by use of eg. Skull Cap or Wild Lettuce to act as a relaxant.
There are numerous herbs White Horehound, Coltsfoot, Hyssop to name but a few that can help the lungs to eliminate and heal.
Placing a bowl of hot water, in a safe place, with the addition of aromatherapy oils Tea Tree or Eucalyptus acts as an airborne inhalation and can help alleviate symptoms, or place aromatherapy drops on a damp cloth over a radiator.