Is the smell only in your hot water? Cold water smells fine? Then it’s the heater. If both stink, the problem is deeper—maybe your well water. But we’re talking just the hot side today.
Fun fact: The stink gets worse if you haven’t used hot water for a while. Bacteria love a lazy vacation. They throw a party the moment you go on a trip. They’re rude.