The reason why some places are hot and some are cold is determined by 2 factors: latitude (location on earth) and the altitude (elevation) of the place.
The equator, which is the closet to the sun gets more heat and places in this area are generally hotter. Regions far from the equator, such as the poles get the least of heat from the sun. Regions above the equator get cooler because of their latitude and it gets cooler as we move towards the poles.
On the other hand, places with high altitude are colder. Even in the equatorial regions, we can see frozen mountains because of their altitude, which happens because of the vertical distance above the sea level which makes the region cooler.