It is important to distinguish among heat, temperature, and thermal energy. These three ideas are related, but the distinctions among them are crucial. In brief,
Thermal energy is an energy of the system due to the motion of its atoms and molecules and the stretching/compressing of spring-like molecular bonds. It is a form of energy. Thermal energy is a state variable, and it makes sense to talk about how changes during a process. The system’s thermal energy continues to exist even if the system is isolated and not interacting thermally with its environment.
Heat is energy transferred between the system and the environment as they interact. Heat is not a particular form of energy, nor is it a state variable. It makes no sense to talk about how heat changes. if a system does not interact thermally with its environment. Heat may cause the system’s thermal energy to change, but that doesn’t make heat and thermal energy the same.
Temperature is a state variable that quantifies the “hotness” or “coldness” of a system. We haven’t yet given a precise definition of temperature, but it is related to the thermal energy per molecule. A temperature difference is a requirement for a thermal interaction in which heat energy is transferred between the system and the environment.
Heat is the energy transferred in a thermal interaction.
It is especially important not to associate an observed temperature increase with heat. Heating a system is one way to change its temperature, but, as Joule showed, not the only way. You can also change the system’s temperature by doing work on the system or, as is the case with friction, transforming mechanical energy into thermal energy. Observing the system tells us nothing about the process by which energy enters or leaves the system.