Most of the times if you are not suffering from any metabolic disease like
diabetes mellitus, hypothyroidism etc , this type of pain comes due to bad posture habits while working and sleeping , secondly lack of regular excercise cause decrease in muscle strength which further aggravates the problem. Also you may be in Vit D deficient state .
Next Steps
The most important and Long term treatment is isometric neck muscles strengthening excercise with back extension excercise.
Health Tips
maintain healthy lifestyle habits