Filter the water. We have good water supplies where I live yet I filter the water. Over many years enough sediment has accumulated in the tank to be a problem. Now I'm dealing with the buildup, slow as it was.
I started filtering several years ago and the water is much better now than before I started.
As a mtce. dose I add ~ 1 teaspoon full of bleach to each 50 gal. tank when I refill . Not even enough for my wife to taste, and darn it she has good taste buds, but at that level of dosing it keeps the water from foul tasting and smelling without causing the bleach taste.
When I was getting that suphurous odour it sometimes took two separate shots of bleach at about two tablespoons of bleach per 50 g tank and then about one to two weeks later I had to do it again. At that point my wife rebelled as the bleach was noticeable. To me OK but not to her.
After and with the filtering, the inital treatments and the ongoing periodic mtce. treatment we have had no more trouble.
And yes, if the H.W. tank has an anode change it.