How to diagnose and fix blue screen of death crashes

Debugging explained

There's nothing quite as frustrating. One moment you're working at your PC, the next your screen turns blue and your system reboots, destroying all unsaved work. Then, an hour or so later, it happens again. What's going on?