Carbon dioxide [tex](CO_{2}[/tex]) is part of greenhouse effect gases because it absorbs long-wave infrared (heat) radiation.
To understand it better:
The Earth has a layer, the atmosphere, that is almost transparent to solar radiation, which is composed mainly of shortwave radiation (ultraviolet (UV) and visible light). Then, this layer allows to pass most of the sunlight (visible light and a small part of the UV radiation), without being absorbed.
When this radiation reaches the Earth, it is absorbed by the water [tex](H_{2}O[/tex]), soil, plants, animals; well, everything that inhabits and also the buildings. Once this absorption process ends, the light turns into long wave (IR) radiation, generating heat that is then released into outer space and known as albedo.
It is at this time that greenhouse gases, such as [tex](CO_{2}[/tex]), enter in scene, absorbing this IR radiation, reducing the heat loss from Earth to space and keeping the planet at a stable temperature for life.
However, the excess of these gases is counterproductive and results in the severe current climate change.