The answer to 'water heater smells bad' is that a rotten egg or sulfur-like odor coming from your water heater is typically caused by a buildup of bacteria in the tank. This is a common issue that can be resolved with a few simple steps.
The most likely cause is the presence of sulfate-reducing bacteria, which convert sulfates in the water into hydrogen sulfide gas, creating the unpleasant smell. This can happen if the water heater has not been properly maintained or if the anode rod needs to be replaced. Flushing the tank and replacing the anode rod are usually the best solutions for this problem.