How to stop car lights being left on

The lights in cars can be a very frustrating experience for users. Most of us who drive have left our lights on and quite a few of us will have come to our cars to find them completely unusable for their primary purpose because of something we hardly realised we did.

In the UK, the major breakdown cover agencies report that they attend 10000s or 100000s of incidents a year where the problem is caused by a flat battery due to lights being left on.

Of course, there are safety concerns: hazard lights must always function indefinitely; and any electronic system must never switch off headlights ...

What would be an absolutely foolproof way of solving this problem without effecting the safety concerns associated with lights being able to stay on indefinitely ?