The best way to prevent whiplash is by using the proper precautions like the head rests in cars. Many people don't adjust the head rest properly, making it so it doesn't protect them in case of an accident.
When getting into the car, be sure that the head rest is 2 inches or less from the rear of your head. If there are more than 4 inches, there is too much room for your head to snap back.
Adjust the height of the head rest so it is directly behind the head, not at the neck level. The head rest should be at the same level as the ears. Since everyone is different in size, don't assume that the head rest is in the right position for you.