Also start reading up on "dip tubes" and how to repair them if you are serious about doing a repair and not a replacement. It's a cheap repair compared to replacement.
When you examine the top of a water heater there are two pipe connections marked "hot" and "cold". If you could see inside the tank, you should find a long tube running from the cold water connection to just above the bottom of the tank.
When hot water is used, it is drawn off the top of the tank; as cold water enters the tank to replace the hot water, it is delivered to the bottom of the tank through the dip tube. But if the dip tube drops off, which will happen, the cold water enters the tank at the top and immediately mixes with the hot water being drawn off the top.
In this case, you can start to take a shower and have plenty of hot water, but the water rapidly cools off as the cold water mixes with the hot in the top of the tank.