The sun emits electromagnetic radiation, of which infrared light and visible light pass largely unimpeded through our atmosphere and strike Earth’s surface and are converted to kinetic energy (heat). This heat slowly radiates back to the atmosphere where the heavier air molecules reabsorb some of the long wave infrared radiation, thus converting it back into kinetic energy once again. As the air molecule heats up, it re-emits infrared radiation in all directions. Some escape into space, the rest are reabsorbed and re-emitted again, etcetera. This process of thermal radiation keeps our biosphere from freezing over.
https://en.m.wikipedia.org/wiki/Radiative_transfer
https://www.livescience.com/50260-infrared-radiation.html
The quantum mechanics of absorption and emission is most easily understood by reading:
https://scied.ucar.edu/carbon-dioxide-absorbs-and-re-emits-infrared-radiation
and by watching a short 5 minute video:
https://youtu.be/-EJOO3xAjTk
More about Greenhouse Effect in this blog (by relevance):
https://samslair.blogspot.com/search?q=Greenhouse+effect&m=1
(by date)
https://samslair.blogspot.com/search?q=Greenhouse+effect&max-results=20&by-date=true&m=1
Especially:
https://samslair.blogspot.com/2018/11/the-story-of-ir-infrared-radiation-and.html?m=1