Hi , This seems to be a neck muscle spasm or called as neck catch in normal terms.
I Advise Tab Flexon thrice a day for 2 days if pain is intense or Tab Dolo 650 thrice a day for 3 days if it's mild.
Next Steps
If it doesn't subside, you can see a physiotherapist. Ultrasound will help you and light soothing massage.
Health Tips
Hot packs can be a home remedy.