Clouds stop the heat from both going in and out from the earth. This process is complex and it changes according to the time, location and the height above the sea level. During the day, more sunlight stops from going in. This cools down the Earth. During the night, the heat in earth stops from going out. This slows down the heat from going out the earth.