It can be due to cervical muscle fatigue /overuse. Muscles go in spasm and becomes painful/weak specially when you bend your neck for long like in cooking /studies /travelling /driving /computer work /table work.
Next Steps
Consult a physiotherapist.. Ultrasonic therapy +IFT +Heating therapy +some strengthening as well as stretching exercises will be helpful for sure.
Health Tips
At home.. Rest +hot water fomentation +pain killer gel +no long sitting /forward neck bending /travelling /driving /computer work +no cold exposure +no manual exertions +no weight lifting.