I have saved up a series of Climate posts to re-post and they are all good and should be read. I will be putting this same message in all of them to save time.
The greenhouse effect near the surface is completely dominated by water vapor, but in the upper atmosphere there is little water vapor – so the greenhouse effect is dominated by CO2, which radiates out into space and cools the planet.