Heat energy is transferred when molecules bump into one another. The direction of heat transfer is always from hot to cold. This transfer of heat energy through direct contact is called conduction.
Relative to other molecules, even of the same substance, hot molecules vibrate more quickly because they possess more energy from a heat source. This vibration causes the vigorously vibrating molecules to bump into other less energetic molecules, transferring heat energy with each collision.
Conduction of heat energy can be easily observed. For example, if one were to take a long metal rod and hold one end over a flame, the heat energy will transfer between molecules from the end in direct conduct with the heat source toward the cooler end. If the rod is held over the flame long enough, the heat energy can travel along the length of the rod, which will become hot to the touch.