I think it may be due to poor posture or doing exercises in wrong way.?
So please keep your posture correct always during work and using mobile phones or sleeping.
Do some isometric exercises of neck.
Next Steps
Please get an x-ray done of cervical spine first.
Health Tips
Do yoga and meditation, exercise under supervision of physiotherapist or best trainer.
Thank you,