Clouds keep us from being cooked alive. If there were no clouds in our atmosphere then no sunlight would be scattered/reflected back into space and we would heat up to intolerable levels (everything else left the same). Yay for clouds!
However, the elevation at which clouds form and the types of clouds affect the cooling and heating of the atmosphere. This is because clouds scatter visible and infrared light at different levels. For example, thin cirrus clouds don't absorb and scatter sunlight very efficiently because they appear translucent. So sunlight gets down to the surface. The surface warms and emits infrared light upward only to encounter cirrus clouds which look opaque in that wavelength. So the cirrus cloud absorbs and re-emits the infrared light back to the ground and the heat is trapped. Cirrus clouds keep the lower atmosphere warm.
On the other hand, liquid clouds cool the lower atmosphere because their density efficiently reflects sunlight back into space. Of course, clouds of all types do trap the infrared light in the lower atmosphere and thus result in warmth at night, but the atmosphere above liquid clouds can cool quickly.
The research on how clouds help or hinder global warming is becoming clearer. The latest research suggests we'll get higher cirrus clouds, which effectively allows sunlight in to heat the atmosphere while trapping infrared; this is a positive for enhancing warming. Meanwhile, a warming atmosphere reduces liquid cloud cover which could reflect sunlight away.