Clouds can block light and heat from the Sun, making Earth's temperature cooler. You've probably noticed this kind of cooldown on a cloudy day. However, some heat from the Sun does get down to Earth. Clouds can trap that heat from the Sun.
Clouds play a vital role in our climate by regulating the amount of solar energy that reaches the surface and the amount of the Earth's energy that is radiated back into space. The more energy that is trapped by the planet, the warmer our climate will grow.