Depends on the manifestation of the energy. For kinetic energy, it can be derived from the amount of work done, and other factors. For chemical energy, it can be computed, or various experimental...
One way is to dip wires from a battery into water. Oxygen bubbles appear at the positive wire (and hydrogen at the negative). This method is called electrolysis.