Dear student,
The heat generation takes place in any electric circuit due to the resistance of different material of wires, switches, bulb, or devices.
Ex.
An electric iron contains coils of high resistance wire made of nichrome alloy. When iron is connected to the power supply by insulated copper wires then a large amount of heat is produced (due to the high resistance), but a negligible heat is produced in the connecting wires of copper because copper has very very low resistance. So it remains cold.
Regards