Average temperature of earth is maintained by the following ways.
1. Atmospheric levels of Greenhouse gases(carbon dioxide,methane etc) prevent excessive cooling of earth during night.
2. Seas and oceans heat up slowly and also lose heat slowly; this prevents sharp decrease in earth's temperature.
3. Low level of carbon dioxide in air prevents heating of earth.
4. Wind convection currents and ocean currents distribute heat evenly on earth.
5. Rotation of earth lets uniform heating of earth by making days and night. Days to warm up and nights to cool down.
6. Seasons too help in cooling down of earth because of earth's revolution.