I have done this so many times (I am Britain's worst driver) when I started to drive - now I leave a big gap at least two cars length and practice anticipation. Practice being the operative word.
I also, a few times a year, find a country road, flat on both sides and dry, and practice full emergency stop from 30 mph to standstill so I have a really good feel for my brakes (now cars have ABS you don't get into skids much).