What to do or take when you have a dry cough?

Acute or chronic? A dry cough can be due to bronchospasm, gerd, post-nasal drip or a combination of these especially if it is a chronic cough (present for weeks) or episodic (resolves then recurs). Treatment is dependent on the precise etiology so you need to see your doctor for evaluation so treatment can be initiated.
Take for dry cough? Treatment of the cause of the cough is your best option. Head elevation can be very useful to alleviate disruptive nighttime cough. If you have asthma, COPD or allergies, make sure they are well controlled. Avoid dust, chemical or fumes exposures by wearing appropriate protective filtration masks. Cough medications are at best a temporary, last resort.