A body is made of matter and matter is made of very small particles called molecules, which are constantly moving.
The molecules in a cold body move little but in a hot body they move more because we have provided heat.
When a hot body comes into contact with a cold body these things happen:
1) the hot body cools down (becomes cold).
2) the cold body heats up (gets hot).
3) both bodies reach the same temperature.
In summary, the heat passes from the hottest body to the coldest body until thermal balance is reached (the two bodies reach the same temperature).