It’s highly recommended that hot water systems are serviced each 2-3 years on average. 5 years for tanks. To find out how old your unit is then check the manufacturer label located on the unit. You’ll see the model and serial number.
There are many factors that could cause the hot water to run out. Common examples are faulty thermocouples, igniters/burners, thermostats or gas supply. Easiest option is to contact your manufacturer to organise one of their contractors to check it out. If not under warranty then you have to pay (whether they find the cause or not), so It’s best to start with the process of elimination.
Check if the issue is localised to one outlet in the house or if it’s affecting them all.
Check the power supply to the unit outside is working (try a charger or hair dryer to plug in and test).
Can you see any leaks around the unit? Check under the unit to see if the hot, cold and gas outlets are connected correctly. That the isolation valve in the gas line is open? The filter might need cleaning? Are your neighbours having similar issues or were there any recent works done in your area? - Tara86
If your hot water system is a smallish rectangular box then it's instantaneous, or if it's a large cylinder then it would be storage.
If it's instantaneous, the flame could be cut off by an out of adjustment or faulty gas regulator. Their purpose is to shut off the flame, if it thinks that the water flow rate is too low. It may be as simple as tweaking the set screw, or it could be brought on if you have hard water and scale has built up.
We had a gas instantaneous HWS and I was able to just tweak the set screw, but if you're not confident, call a gas fitting plumber.
All HWS have Pressure Relief Valves (brass body & a tin coloured lever which looks like a trigger) and they need to be manually exercised every 6 months. - Andy_Mann
Continuous hot water systems may require professional servicing if there is a fall off on the hot water. however please check the following:
#1. Do you get the same hot water drop out in the kitchen or does it stay steady? If yes check laundry and other taps, if symptoms are the same skip to #3. If no, continue to #2.
#2. Have your regulator checked. Is it auto transfer or manual transfer? Some auto units fail and only switch halfway when the first tank is empty, providing minimal gas and making the hot water unit think you’re running out of gas. Switch has failed? Replace with more up to date models. If not, continue to #3
#3. It could be distance to shower and exposed copper pipes. Sometimes distance plays a part and you may need to put lagging on the copper pipe to provide insulation.
However if the symptom has only recently arisen there is one more port of call and that is your tempering valve. It could have failed and may be excessively cooling your hot water, turning the tempering valve to full hot should eliminate the cause, if so then you know it has failed and can be replaced. Beware that a faulty tempering valve can cause excessive hot water to flow though your pipes and scald the person using hot water! Please be safe when testing, council regulations in your area may require a tempering valve and please note that a registered plumber may be required to do this. If this still fails then step 4 is your last stop.
#4. If the unit is more than 10 years old it may be time to service it. - redracer01