Complaints about hot water divide neatly into two, and the division does most of the diagnostic work before anyone looks at anything.

No hot water at all
On an electric storage heater with two elements, this usually points at the upper element or its thermostat. The upper element heats the top of the tank, which is where hot water is drawn from, so when it fails the tap runs cold even though the lower part of the tank may be warm.
It can also be the supply — a tripped breaker, a blown fuse, or on many tanks a reset button on the upper thermostat that has tripped. That button exists as a safety cutout and it trips for a reason, so a heater that trips it repeatedly has an underlying fault rather than a nuisance.
On a gas heater, no hot water usually means the burner is not lighting: a pilot that has gone out, a failed thermocouple, or an ignition problem.
Hot water that runs out very quickly
This is the more informative complaint. A tank that delivers a few minutes of hot water and then goes cold usually has a working upper element and a failed lower one. The top of the tank heats, you use it, and there is nothing behind it.
The other common cause is sediment.

Minerals settle out of the water and build up in the bottom of the tank over years. That layer insulates the lower element from the water, so the element heats the sediment rather than the tank, and the usable capacity drops. In hard water areas this happens faster and is a routine maintenance issue rather than a fault.
A tank that has been fine for years and is gradually giving less hot water, with a rumbling or popping noise as it heats, is describing sediment fairly precisely — the noise is water boiling in pockets under the deposit.
Lukewarm rather than hot
If the water is warm but never properly hot, look at the thermostat setting first, then at the possibility of a crossed connection somewhere in the plumbing, where cold water is mixing into the hot supply. A failing mixing valve at the tank or at a single fitting can do this, and the giveaway is that one particular tap behaves differently from the others.
Worth knowing before adjusting anything: turning a thermostat up carries a scalding risk, and there are recommended settings that balance that risk against the temperature needed to suppress bacterial growth in a stored tank. Those settings are not arbitrary.
What is safe to do
Checking the breaker, pressing a tripped reset button once, and looking at the thermostat setting are reasonable. So is draining a few litres from the tank's drain valve into a bucket to see how much sediment comes out, though on an old tank a drain valve that has never been opened sometimes will not close again afterwards.
Beyond that, a storage water heater combines mains electricity or gas with a large volume of very hot water under pressure, and the failure modes are worse than those of most appliances. Elements are replaced with the tank isolated and drained, and gas work is a job for a registered person in most places by law.
The age question
Storage tanks have a service life, commonly quoted at around eight to twelve years, and the anode rod that protects the tank from corrosion is consumed over that period. A tank that is at or past that age and is now underperforming is often better replaced than repaired, because the next failure is likely to be the tank itself — and that one arrives as water on the floor.
