Turn off the water and gas valves feeding into the water heater.
Locate the thermostat control on the outside of the boiler. There will be two gas tubes and one thermocouple lead connecting to the solenoid on the bottom.
Use an adjustable wrench to disconnect the nuts holding the gas tubes and thermocouple lead to the thermostat.
Pull the lines you just disconnected, along with the burner unit, away from the water heater. Depending on the design of your water heater, you may have to unsnap clips holding the burner in place before you can pull it out.
Pull the thermocouple out of the mount holding it toward the burner. Insert the new thermocouple into this mount.
Place the burner back in the water heater and use the adjustable wrench to reconnect both gas lines and the new thermocouple lead to the thermostat control. Turn the water and gas back on.