If your gas fire isn’t working properly and goes out too often you probably need to change the thermocouple – a small device that shuts down the gas supply if the pilot light goes out.
How to Replace the Thermocouple
Turn off the gas and make sure the pilot light goes out.
Wait twenty minutes for the thermocouple to cool down.
Loosen the screws that hold the thermocouple in place.
Pull the thermocouple out with long nosed pliers.
Put the thermocouple on a surface that will not burn (just in case).
Clean the screw terminals.
Insert the two wires of the new thermocouple and tighten the screws.
Turn on the gas and re-light the pilot light.
Wait a while and then turn on the fire. If you have replaced the thermocouple correctly the fire will light.
Thermocouples need to be checked regularly but replacement is the only option for repairs.