The base graphic is from Wikipedia, with my annotations. There are two main "windows" in the Atmospheric "greenhouse effect". The first, the Visible Light Window, on the left side of the graphic, allows visible and near-visible light from the Sun to pass through with small losses, and the second, the Longwave Window, on the right, allows the central portion of the longwave radiation band from the Earth to pass through with small losses, while absorbing and re-emitting the left and right portions.
To understand how these Atmospheric windows work, we need to review some basics of so-called "blackbody" radiation. As indicated by the red curve in the graphic, the surface of the Sun is, in effect, at a temperature of 5525ºK (about 9500ºF), and therefore emits radiation with a wavelenth centered around 1/2μ (half a micron which is half a millionth of a meter). Solar light ranges from about 0.1μ to 3μ, covering the ultraviolet (UV), the visible, and the near-infrared (near-IR) bands. Most Sunlight is in the visible band from 0.38μ (which we see as violet) to 0.76μ (which we see as red), which is why our eyes evolved to be sensitive in that range. Sunlight is called "shortwave" radiation because it ranges from fractional microns to a few microns.
As indicated by the pink, blue, and black curves in the graphic, the Earth is, in effect, at a temperature that ranges between a high of about 310ºK (about 98ºF) and a low of about 210ºK (about -82ºF). The reason for the range is that the temperature varies by season, by day or night, and by latitude. The portion of the Earth at about 310ºK radiates energy towards the Atmosphere at slightly shorter wavelengths than that at about 210ºK, but nearly all Earth-emitted radiation is between 5μ to 30μ, and is centered at about 10μ.
The graphic is an animated depiction of the Atmospheric "greenhouse effect" process.
(1) Sunlight streams through the Atmosphere towards the surface of the Earth.
(2) A portion of the Sunlight is reflected by clouds and other high-albedo surfaces and heads back through the Atmosphere towards Space. The remainder is absorbed by the Surface of the Earth, warming it.
(3) The reflected portion is lost to Space.
(1) The warmed Earth emits longwave radiation towards the Atmosphere. According to the first graphic, above, this consists of thermal energy in all bands ~7μ, ~10μ, and ~15μ.
(2) The ~10μ portion passes through the Atmosphere with litttle loss. The ~7μ portion gets absorbed, primarily by H2O, and the 15μ portion gets absorbed, primarily by CO2 and H2O. The absorbed radiation heats the H2O and CO2 molecules and, at their higher energy states, they collide with the other molecules that make up the air, mostly nitrogen (N2), oxygen (O2), ozone (O3), and argon (A) and heat them by something like conduction. The molecules in the heated air emit radiation in random directions at all bands (~7μ, ~10μ, and ~15μ). The ~10μ photons pass, nearly unimpeded, in whatever direction they happen to be emitted, some going towards Space and some towards Earth. The ~7μ and ~15μ photons go off in all directions until they run into an H2O or CO2 molecule, and repeat the absorption and re-emittance process, or until they emerge from the Atmosphere or hit the surface of the Earth.
(3) The ~10μ photons that got a free-pass from the Earth through the Atmosphere emerge and their energy is lost to Space. The ~10μ photons generated by the heating of the air emerge from the top of the Atmosphere and their energy is lost to Space, or they impact the surface of the Earth and are re-absorbed. The ~7μ and ~15μ generated by the heating of the air also emerge from the top or bottom of the Atmosphere, but there are fewer of them because they keep getting absorbed and re-emitted, each time with some transfered to the central ~10μ portion of the longwave band.
Even though estimates of climate sensitivity to doubling of CO2 are most likely way over-estimated by the official climate Team, it is a scientific truth that GHGs, mainly H2O but also CO2 and others, play an important role in warming the Earth via the Atmospheric "greenhouse effect".