Know the colours
In the UK, unleaded petrol (E10 and E5) pumps usually have green nozzles and labels; diesel pumps are usually black. Labels E10 / E5 mean petrol; B7 / B10 mean diesel. Don't rely on colour alone — some forecourts differ.
Habits that work
Read the label on the nozzle before you lift it. Put a fuel-type tag on your key ring. Be most careful in a new, borrowed or hire car, and when you're tired or in a hurry.
Misfuel-prevention devices
A misfuel-prevention insert or cap for diesel cars blocks the narrower petrol nozzle. They cost much less than a single drain.