Electrical energy is the ability of an electrical system to do work.
Energy is expended when work is done and the amount of energy used is equal to the work done. The units of energy and work are the same, that is joules and the same equation is used for both.
Energy = Work = VIt joules
The energy a body contains may be determined by calculating the electrical work done on the body to give it that energy. Conversely, the work that a body could do if it used up all its energy may be determined by calculating how much energy it contains.
This assumes that no energy is lost in the conversion. In practice energy is often 'lost' in the form of heat.
However no energy is actually destroyed, it is simply converted into some other form. This is stated in the Law of Conservation of Energy - energy can neither be created nor destroyed but merely changed into other forms.