First of all, unless you sustained an injury or your head was bent in an awkward position for several hours, such as sleeping with head drooped down with your head turned you most likely can successfully get out of pain without resorting to pain pills or costly injections.
Most of the time, muscles in your neck have been twisted by not being in a neutral position and therefore, causing your vertebrae in your neck to be distorted putting pressure on nerves that are causing your pain.
What Should I Not Do If I Have Neck Pain?
Most people think that the pain in their neck is coming from that area. Not so. If you were to take a side photo of you sitting, you would almost always see a slouched rounded mid back and your head sticking forward way past your shoulders.
There is no way you will be able to maintain a proper and balanced head and neck alignment in this position.
What Should I Do Then If I Need to Work Sitting Down?
Until then sit on the edge of your chair and when you get tired or notice your posture decline get up and move around.