Fundamentally, the laws of thermodynamics tell energy how it can behave. These rules will dictate whether energy flows into or out of a system, depending on whether the system is at a higher or lower temperature than its surrounding environment. Heat is the name we give to the energy that is transferred between the environment and the system based on temperature differences. If the temperature of the system is greater than the temperature of the environment, then energy will flow from the system to the environment as heat. On the other hand, if the temperature of the system is less than the temperature of the environment, then energy will flow into the system from the environment as heat. This energy will flow between the system and the environment until they both have the same temperature. At that point, the system and its environment are in thermal equilibrium.
None of this information is actually new. If you take a cup of hot tea and set it out in a room, the tea will give up energy as heat as it cools. This transfer of energy as heat from the tea to the air in the room will continue until the tea reaches room temperature. Because the room is large, the additional energy that has been transferred to the room as the tea cools doesn’t actually change the temperature of the room. However, if you place your hands close to the cup, you can feel where the energy transferred to the air in close proximity to the cup increases its temperature, though the temperature change due to that very local increase in energy is small and quickly dissipates as you move away from the cup.