To prevent tailgating, drivers should follow the:

Most rear-end collisions are caused by tailgating. To avoid tailgating, use the “Three-Second Rule.” When the vehicle ahead of you passes a certain point, such as a sign, count “one-thousand-one, one-thousand-two, one-thousand-three.” If you pass the same point before you finish counting, you are following too closely.
DMV Writen Test