Thanks for posting your query.
From description, it seems due to muscle spasm. Beside taking muscle relaxant
and pain killer and applying hot water bottle, you have to do regular neck and shoulder exercises.
I would suggest getting this evaluated by an orthopedician for an accurate diagnosis and appropriate management.
Wishing you good health.
Dr Saurabh Gupta.