The answer to 'my water heater smells bad' is that a rotten egg or sulfur-like odor coming from your water heater is usually caused by a buildup of bacteria in the tank. This is a common issue that can occur if the water heater is not properly maintained.
The most common causes of this problem are a lack of water heater maintenance, a malfunctioning anode rod, or high levels of sulfates in the water supply. The smell is caused by hydrogen sulfide gas that is produced when the bacteria feed on the sulfates in the water.