To avoid confusion over debits and credits, avoid thinking of them in the way that they are used in everyday language, which often refers to a credit as increasing an account and a debit as decreasing an account. For example, if our bank credits our checking account, money is added to it and the balance increases.
One way to reduce the frequency of this occurrence is to maintain an air pocket at the top of the water heater tank. This air pocket will form in the tank by design - however, it will be reduced over time by the everyday use of your water heater. To replenish this air pocket: Turn off the water heater.
Your water heater is filled from the cold water running in a tube to the bottom of the water heater. Since heated water rises, the top element just maintains the upper part of the water as the outlet hot side is on the top. So, If you start out with good hot water - and it starts to quickly turn cooler - you know the bottom element is bad + you can put your ear up to water heater and hear which element is on. I am with the person who said to change them both. Turn off incoming water supply - let off water pressure at another faucet.