Heat flows from a hot body to a cold body. When two bodies, one hot and another cold, come in contact with each other, the fast moving molecules of the hot body collide with the slow moving molecules of the cold body and the molecules of cold body becomes faster. As a result, the molecules of hot body become slower and the body becomes cooler, whereas the cold body becomes warmer. This continues till both the bodies reach a common temperature, i.e thermal equilibruim is attained.