Track down a bug methodically: ranked hypotheses, the quickest test for each, the root cause once found, a minimal fix and a regression test so it stays fixed.