We know that whenever electricity passes through a wire, it gets hotter, after a few minutes of playing games on your laptop while charging, you will see that the charger gets hot, or the laptop itself gets hot, why? well because of how fast the electrons are rushing in and out of the laptop through the charger, that creates friction against the wires which then leads to joule heating or so-called the heating effect of electricity.
Joule heating:
The absolute reason for the heat is due to the collision between electrons and atoms. We know that electrons don't flow, they bounce off of atoms, and as a result, the collision transfers an amount of energy to the atoms which makes the atom vibrate resulting in heat. How to calculate the amount of heat? well, we just need to find how much electricity we are losing for example in a bulb, if we are losing 200 joules of electricity that means we are generating almost 200 joules of heat energy.
The formula to find the power dissipated(a scientific term for heat generation through electricity) is H = V * I * T The heat generated = Voltage times current times time.