Whiplash usually can be prevented. That sounds unlikely, since many cases of whiplash come from car accidents where you're rear-ended, and it's hard to prevent those.
Also, adjust your car to ensure optimum safety by checking that the headrest is not too low—the top of the headrest should be even with the upper tips of your ears, and must be close enough to stop your head from moving too far (about 2 inches). A seat reclined back too far will increase this distance, as will poor posture.
In 2007, the Insurance Institute for Highway Safety (IIHS) found that two-thirds of all SUVs, pick-up trucks, and minivans did not offer adequate protection against whiplash. They reported that in some pick-ups especially, the headrests couldn't be adjusted enough to provide the right kind of support during a crash. Before buying a new car, truck, or van, do your research to make sure that you're getting the best protection for your neck.
Aside from car accidents, whiplash often happens in sports injuries. If you play sports, especially contact sports like football, always make sure you wear the proper protective equipment.