First of all, you need to select a comfortable chair. By choosing a soothing, relaxed chair could help you avoid many issues. The chair should be so restful that it puts no pressure on your back.
Avoid stretching out your legs too much. You may find this activity a little comfortable in the beginning, but it creates many problems in the long run. Sitting with legs fully stretched out puts a lot of pressure on the lower back.
Another thing that needs to be avoided is crossing your legs or ankles. Ladies, in particular, sit in this position for hours. They should quickly leave this habit, because this position not only strains the lower back, but also the calf muscles and thighs.
In order to keep your muscles loose at a desk, you should change your body position often. A lot of people make this simple mistake when focussing on a particular task. Even if your job requires great deal of concentration, you need to take 3-5 minutes of break every while.
Rotate your neck periodically. This should be done in order to relieve the neck strain. After rotating your head in one direction at least for 10 seconds, move the neck in the other direction.
A foot massage could help you keep your muscles relaxed. Take a bottle of warm water, and place it under your desk. After removing your shoes, roll the bottle back and forth under your feet.
Take deep breaths. This can be done even in the middle of a project. Sometimes, taking deep breathes reduces muscle tension to a great deal.