Sometimes hot sometimes not so…
Gas water heater. The pilot went out once, but an inspection (by me) revealed nothing.
I moved in in early autumn and turned the temp WAY down from where the previous owner kept it.
My main complaint is that the temp. is not consistent. I would like to keep it so that ALL HOT water showers are comfortable.
You need to turn the temperature back up. You need to mix more cold water with the hot at the shower. When you use hot water, cold water is going into the tank to replace it, lowering the average water temperature in the tank. At a lower initial temperature in the tank, the average temperature will approach the cold water temperature faster.
Check the dip tube. Incoming cold water is directed to the bottom of the tank where it is heated while hot water at the top flows to the point of use. Dip tubes go bad, allowing cold water to flow in and right back out the outlet.
Remove the inlet piping. Usually the dip tube was just slid into the inlet and you should be able to pull it out if it is there. Probe around with a wire and see if it can go sideways or must go straight on down.
Other possibilities? The thermostat is bad. You have a heavy layer of sediment on the bottom requiring long, wasteful heating times.