The answer to '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 be addressed with some simple maintenance.
The most likely cause is the presence of sulfate-reducing bacteria that produce hydrogen sulfide gas, which gives off the unpleasant smell. This can happen if the water heater has been sitting unused for a while, or if the anode rod (which helps prevent corrosion) needs to be replaced.