When some potential difference V is applied across a resistance R, then the work done by the electric field on charge q to flow through the circuit in time t will be
W = qV = Vit = i2Rt
This work appears as thermal energy in the resistor.
Heat produced by the resistance R is
This relation is called joules heating.