To replace the valve you remove the pilot line, main burner and thermocouple. Then use a large pipe wrench to unscrew the valve from the tank. Most people just buy another heater because investing in a new valve may be a waste of money if the tank is rusty. Dumping a bunch of money into a tank that might spring a leak at any time is risky. Now if you found a leaker with a good valve on it then you could maybe make a good water heater out of 2 bad ones. Just something to think about. That valve is not fixable, no parts are available and that is intended. Manufacturers outlawed repairing gas valves years ago. TY Ralph Nader.