Thanks for writing your query.
After reading your post, it seems that your pain is due to sprain
of the neck muscles as a result of coughing.
I would advise that you should get yourself clinically examined and investigated for cause of cough and take medication accordingly.
You can take an antihistamine like Fexofenadine
120 mg once a day for relief from cough.
If chest auscultation indicates bronchitis
then a bronchodilator
may be helpful.
Warm saline gargles are also helpful.
Also get yourself investigated for :-
1. Complete Blood Count
( CBC ).
2. Throat swab culture.
3. Sputum examination.
Further medical management can be planned according to the reports of the above mentioned Investigations.
I hope this is helpful to you.