what keeps the earth cool during the day and warm at night?

Mostly the heat capacity of the air and ground