The same rules apply as with backs, use ice packs for an injury or heat for chronic/tense necks.
Keep good posture in all positions especially sitting, put a cushion in the low back and sit on a firmer chair. This advice applies at home and at work, especially if you work at a computer.
Whiplash injuries take 6-8 weeks to mend and the pain can take up to 6 months to fully resolve. It is best to keep moving gently and regularly to prevent stiffness and to help healing.
Drink plenty of water and use pain killers to help maintain your activity.