When your water heater at home is broken, your first impulse may be to replace it. Replacing a water heater is quite expensive so it is important that you check to see if it can be repaired. You may even be able to fix it yourself.

(Pixabay / reverent)
There is small metal cylinder called the thermocouple that is located in front of the pilot light. It is a safety device to sense if the pilot light burns out. When the pilot light is extinguished, the thermocouple will signal the gas valve to stay closed until the pilot light is working again.
The pilot light goes out when the thermocouple becomes worn out, leaving you with no hot water in the house. You can try fixing the problem by first relighting the pilot light. Instructions on how to do this are provided in the directions that you will find affixed to the tank. The pilot light might ignite while you are holding the button, but if it goes out again after you release the button, something is wrong with the thermocouple.
You can replace the thermocouple without having to remove the entire burner assembly. However, removing the burner assembly will make it easier to make the replacement. Removing the assembly will also allow you to clean the burner compartment.
Thermocouples come in different sizes. Measure the one you removed from the burner assembly and find the same size in your local hardware store.
Removing the burner assembly and replacing the thermocouple will be simple if you know how to turn off the gas that goes into the water heater and if you are comfortable reigniting the pilot light. If not, do not attempt this repair, as it could prove dangerous. Call a professional to assist you with the repair.