Welcome to Healthcare Magic
Due to your nasal congestion
and postnasal drip which could have occurred due to possible sinus infection
you have trouble breathing especially at night and due to the low oxygen in your blood you wake up with severe headaches
as well. The cough is due to accumulation of nasal and pharyngeal secretions. You can do steam inhalation for relief. Sleep on your side rather on your back. Avoid eating heavy meals at night. You can elevate the head end of your bed while sleeping. You should consult and ENT Specialist
to examine you and treat you appropriately.