The formula that links energy and power is: Energy = Power x Time.
The unit of energy is the joule, the unit of power is the watt, and the unit of time is the second. If we know the power in watts of an appliance and how many seconds it is used we can calculate the number of joules of electrical energy which have been converted to sortie other form.
E.g. If a 40 watt lamp is turned on for one hour, how many joules of electrical energy have been converted by the lamp? Energy (w) = Power x Time Energy = 40 x 3600 = 14,400 joules