The greenhouse effect increases the temperature of the Earth by trapping
heat in our atmosphere. This keeps the temperature of the Earth higher
than it would be if direct heating by the Sun was the only source of
warming.
When the sunlight reaches the surface of the Earth, some of it is absorbed
which warms the ground and some bounces back to space as heat. Greenhouse gases that are in the atmosphere absorb and then redirect some of this heat back towards the Earth.