The relationship between Heat and internal energy is just like the relationship between work and mechanical energy. Heat is a measure of the internal energy change of an object. If the thermal balance between the two areas has not been reached, then the heat will be transferred to the other side with low temperature at the place with high temperature between them.
Any substance has a certain amount of internal energy, which is related to the disorderly movement of atoms and molecules that make up the substance. When two substances with different temperatures are in thermal contact, they exchange internal energy until their temperatures are the same, that is, they reach thermal equilibrium. Here, the amount of energy transferred is equal to the amount of heat exchanged.
Many people confuse heat with internal energy. In fact, heat refers to the change of internal energy and the work done by the system. Heat describes the change of internal energy, which is a state quantity and a state function of the system, corresponding to a state point of the system.
Fully understanding the difference between heat and internal energy is the key to understand the first law of thermodynamics. In the process of heat transfer, the heat transferred between objects is related to the process (adiabatic, isothermal, isobaric), that is, endothermic or exothermic must be carried out in a certain process. When an object is in a certain state, it cannot be said how much heat it contains (heat is a process quantity, a change quantity).