In the ancient mythology, Hercules slew the Hydra, a monster which could grow a new head for each one cut off. Does that remind you of your programming job? The punchline is: Hercules didn’t conquer his opponent with brute force but with brains.
So if your product sprouts two new bugs for each you fix, it’s time to take the fingers away from the keyboard and start rubbing your head.
The solution? Unit tests. Each test makes sure that a piece of code works as it should. Even if each tests looks dump and futile, in a mass, they make sure that all the code which you didn’t change still behaves as you expect.
Kudos to Thomas E. Deutsch for the idea of the Hydra.