Remove rust from a hot water heater by draining out all the rusty water, using a brush or vacuum to remove sediment and repeatedly flushing the heater. To prevent more rust from forming, replace the sacrificial anode that retards rust formation.
Turn the water heater knob down to the pilot or vacation setting, and close the valve that allows water into the tank. Attach one end of a hose to the water tank drain valve and put the other end in an outlet such as a floor drain where the water can safely drain away. Open the drain valve, and also open a hot water tap at a nearby sink to prevent a vacuum and facilitate drainage. When the water has mostly drained away, open the cold water intake valve and allow cold water to flush through the tank. If there is a large accumulation of sediment, you may have to remove the drain valve and use a long narrow brush or a wet vacuum to remove the excess sediment.
Replace the drain valve, close it, fill the tank with water and let it run out. Repeat this process several times until the tank is well flushed. The anode is a metal rod made of magnesium, aluminum or zinc that corrodes in a process of electrolysis so the steel water tank does not rust. Remove and replace the corroded anode to protect the water heater. To prevent future rust, flush the tank and check the anode every six months.