
The key here is to keep a safe following distance beforehand, so you have time to react when the car in front brakes. When you see it slowing, brake too, but do it smoothly while watching the traffic behind you. Braking harder than you need to can endanger the drivers following you.