CO2, methane and other gases contribute to the greenhouse effect.
But most of the greenhouse effect is caused by water vapour in the atmosphere. There is always a lot average moisture present, but it is limited by precipitation. It causes most of the total greenhouse effect, without it, the surface would just radiate heat away from Earth.
If there were no moisture in the air, that should make the average surface temperature much lower. (It is not physically possible, of course.)
What would that temperature be?