Water heaters are usually reliable members of the household appliance family. They are relatively simple devices, with few components to cause trouble. Yet, they do fail after some years of service and have to be replaced. Water heaters are not expensive, but they are not consumer appliances either. If your water heater isn't working as well as it has in the past, you may want to troubleshoot it by looking at those components most likely to fail.
There is one sure sign that a water heater has failed: a puddle of water on the floor. It had to come from somewhere, and there aren't too many options. Either the water heater's thermostat has failed, or the tanks stainless steel body had corroded sufficiently enough to cause a leak.
First, it could be a discharge of overheated water from the T&PR valve. The Temperature and Pressure Relief valve discharges overheated water in case the heater's thermostat fails. If the water heater's temperature and internal pressure exceeds certain preset limits, the valve will open enough to relive the pressure by shunting hot water out through the discharge pipe. If the water isn't being overheated, then the obvious culprit is a leaking tank.
If you have a thermometer handy, you can check the temperature of the water easily enough. It shouldn't be anywhere near 210 degrees F. The best, and safest temperature range for hot water is 120 degrees F. At this temperature, it would be practically impossible for the heater to generate sufficient internal pressure to cause the T&PR valve to open.
Once you've ruled out the T&PR, the water temperature and pressure, the next step is to check the bottom of the water heater for pinhole leaks. Once you find the source of the leak, you can think about replacing the heater with a new, more energy efficient model.
Temperature control wise, there are two possible culprits. In a gas water heater, a thermocouple device controls the pilot light and the water temperature. If you aren't getting a sufficient supply of hot water, or if the water isn't hot enough despite the setting of the temperature control, it is likely that the thermocouple device isn't working properly. These can be replaced, but you should only have it done by a qualified technician or a license plumber.
An electric water heater has two heating elements and a thermostat to consider. On a typical unit, there is both an upper and a lower heating element, either of which is prone to burn out over time. They can be removed, tested, and then replaced, if need be, without a lot of difficulty. Thermostats are usually more reliable, but they too can fail on occasion. I would suggest that you consider having a qualified technician or licensed plumber perform the troubleshooting at this point due to the presence of an electrical hazard.
This completes a brief discussion to troubleshooting water heaters. Although water heaters of any type are not overly complicated, they should always be approached with safety in mind. There is electrical shock, scalding, and fire hazards associated with both types and repair should be left in the hands of qualified professionals.