When the electric field is applied across the ends of the resistor, the free electrons of the resistor accelerate and hence gain kinetic energy. these electrons collide with the nearby electrons and lose their kinetic energy. This loss of kinetic energy is converted into heat energy.