Hi..Gm.., it seems ur neck went in spasm because of inappropriate posture n weakness of neck n upper back muscles
Next Steps
visit a physiotherapist
take ift/ cervical traction
gradually take supervised exercises
learn n follow posture n ergonomic advice
Health Tips
avoid forward bending of neck
use thin pillow
u can visit my clinic in wakad pune