Energy can be defined as the capacity to do work. It can be related to the work done. Work done can be defined as the transfer of energy from one body to another. After the energy has been transferred it is designated according to its nature.
Work is done when a particular amount of energy is consumed by the body or object. Energy can be in the form of mechanical energy, thermal energy, chemical energy, et cetera.
This is how the energy is related to work done.