It always seems that water heaters time their demise just perfectly-Christmas Eve, weddings and shower time.
There are several possible causes. So, check the heating elements, the thermostats and the dip tube. An electric water heater uses two heating elements to heat the water: one near the top of the tank and one near the bottom.
The bottom element does the bulk of the heating work, while the top plays backup during periods of high demand. Each element has a thermostat that you can sometimes adjust, but since the heater was working fine and only recently started acting up, I doubt that adjusting a thermostat will fix it. (You may have to replace one, however).
A broken dip tube may also be the culprit, as the device is responsible for forcing the incoming cold water down to the tank's bottom to get heated. The hot water then rises to the top and out through your showerhead. If the tube is broken, the cold and hot water mix at the top of the tank and you get hot water-initially, until it turns lukewarm.
The thermostats are located on the side of your tank under metal panels. Turn off the power to the water heater at the main service panel and remove the covers that hide the elements. The first thing to check is if the reset button has tripped on either element. To cure this, just push the red button and it should resume heating normally. Realize though, that there may be an underlying problem that made the button trip.
If you have adjustable thermostats, you can use a screwdriver to change the setting. Turn the screwdriver clockwise for hotter and counterclockwise for a cooler heat setting. Like I said earlier, I doubt this will fix your problem.
Start with the upper thermostat and test it for continuity using a multimeter. If it is faulty, remove the wires and unscrew it from the side of the tank. Install a new thermostat and adjust the settings according to the manufacturer's instructions. You can test and replace the lower thermostat in the same manner.
Next, check the heating elements. Again, use the multimeter and test each element. Disconnect one element wire, and then touch one probe of the multimeter to an element mounting bolt, and touch each of the terminal screws, one at a time. If you get a bad reading, you need to replace the element.
To replace the element, drain the tank. Attach a hose to the bottom of the tank at the hose connection and open the valve. You will have to allow air into the system to get the water flowing, so open the nearest hot water faucet after you close the cold water supply valve at the top of the tank.
Once the tank is drained, remove the wires from the heating element and then unscrew the mounting bolts that hold the element in place. Remove the element and replace it with a new one of the same rating. You may find that once you have the element out, it may be covered with caked-on sediment. This could also be the culprit.
After you reattach the mounting bolts and screws, you will have to fill the tank back up with water and turn the power back on, as well as adjust the thermostats. With any luck, you will be enjoying hot showers in no time.
Before you sink money into your water heater, you might consider its age and how many more useful years it has left. If it is 6 years old, is it worth sinking $100 and a few hours of your time into it? Maybe. Most water heaters are out of warranty by this age and it could last a few more months or a few more years. You might consider replacing your water heater.