Hey there! It seems you might have done some jerky movement or slept in improper position due to which the neck muscles have gone into spasm. Apply dfo cream or any other diclofenac cream. You may spray diclofenac spray. If you can, you may very slowly and mildly massage in top to bottom fashion linearly over the painful area of neck.
Once the pain subsides, do neck flexion, extension, side flexion to both side, rotation exercises; chin tuck exercises and for strengthening your neck muscles, which seem to be weak, do axial extension exercises of neck. Stretching of neck muscles.
For understanding how to do exercises and better diagnosis, please consult online.
Next Steps
do as advised.
Health Tips
do not do any forceful movements of neck at present in pain. use very thin soft pillow or do not use any pillow. while using pillow keep in mind to keep pillow under neck more rather than head. The neck should be supported and head should be inline with torso.