we know that
volt= work done/ total charge or v = w/q
from this we get w= vq
we know that current i = q / t
so q = it
putting this in prev equation
we get w = vit
from ohms law v = ir
putting it in prev eq we get
w = irit = i^2rt joule as work is stored as heat so H = I^2RT Joules