How is greenhouse effect produced?
The solar rays consist of heat radiations. These radiations can easily pass through the atmosphere. These radiations are absorbed by the Earth's surface and temperature of the Earth rises during the daytime.
At night, the Earth radiates out heat radiations which cannot easily penetrate through the atmosphere because carbon dioxide and clouds act as excellent reflectors.
Thus, heat radiations are trapped in the atmosphere which keeps the Earth warm during the night. This trapping of outgoing solar heat energy in Earth's atmosphere is the greenhouse effect.