
Neck pain caused by too much stress or muscle strain can often be prevented through adapting proper posture, taking regular breaks when working, choosing firm seating and having good sleeping habits.
If you work in a office, chance is you sit in front of a desk a lot. To avoid slouching, the top of your computer screen should be at around eye level; sit straight in the chair with a firm backsupport, which put less stress on the spine and hence reduce load on neck and back muscles.
Take regular breaks, every 20 or 30 minutes is advisable. Passing a report to your colleague? Picking up printed material? These are all perfect opportunities for you to stretch your neck muscles - slowly rotate your head clockwise then counter-clockwise; tip your head sideways, such that the ear is close to the shoulder; tilt the head to look up while move both shoulders up and down a few times - all effective short term solutions for muscle relaxations.
Sleeping habits is too important to ignore because after all, we spend about 1/3 of our lives sleeping (excuse the cliche), having a suitably sized pillow then, helps relaxing. Keep in mind that When sleeping it is ideal that your lumbar, thoracic and cervical vertebrae are on a straight line, and your pillow should do just that. Note that a different pillow might be advisable if, for
example, you change from sleeping on sides (usually thicker pillow) to sleeping on the back (i do not use a pillow when on my back, as my mattress is soft enough).