Consider a current I flowing through a resistor of resistance R. Let the potential difference be V. Let t be the time during which a charge Q flows through it.
The work done in moving the charge Q through potential difference V is VQ. Therefore, the source must supply energy equal to VQ in time t. Hence the power input by the circuit in the source is
P = V*Q/t = VI (since Q = It)
Or the energy supplied to the current by the source in the time t is P*t that is VIt. The energy expended by the source gets dissipated in the resistor as heat. Thus for a steady current I, the amount of heat H produced in time t is
H = VIt
Applying Ohm's law, we get
H = I²Rt