If you have a private well, the problem might be in the well itself, not just the heater. This is when you channel your inner pool boy. Pour one to two quarts of unscented household bleach directly into the well head (yes, into the casing). Let it sit for 12–24 hours, then run all your taps until the bleach smell is gone.
Caution: This can kill good bacteria in your septic system, so do it sparingly. And please, don’t try this if you’re on city water—you’ll just make your whole neighborhood smell like a laundromat. Trust me on this.