You either have a burnt out thermocouple lead or a partically blocked pilot injector and if the heater has not been serviced it is very likely to be full of lint etc which has created this problem. I would recommend you obtain the services of a qualified Gasfitter or Serviceperson to check and service the heater for you as I would not recommend that a customer attempt this action themselves in the interest of safety.
Selgas Services Ltd
Craftsman Gasfitters, Plumbers, Electrical Service Technicians