1) the sun emits electromagnetic radiation mainly as visible light, UV radiation and infrared radiation
2) most the UV and IR are absorbed by the earth's atmospheric gases and some radiation is reflected back into space from clouds
3) the energy that reaches the earth's surface is mainly visible light and UV. Some is reflected into space by light coloured,shiny surfaces like ice and snow. The rest is absorbed by the earth causing it to heat up
4) the earth then radiates infrared radiation
5) some of the IR escapes through the IR window
6) greenhouse gases in the troposphere absorb some of the remaining IR in the IR window and re-emit in all directions