Hello, greetings from Kolkata.
The kind of pain you are experiencing is generally caused by neck muscle spasm.
The common causative factors are bad posture during sleep, prolonged neck bending during watching any screen of tv/mobile/laptop.
Try to keep your neck straight. Oral muscle relaxants would help. Can give hot fomentation and apply any diclofenac gel.
Next Steps
Contact me through practo if you need any further assistance
Health Tips
Do daily neck muscle strengthening (isometric and active) to prevent similar occurence in future.