CO$_2$ doesn't significantly interact with solar radiation or UV, and doesn't store any significant amount of heat. What CO$_2$ effectively does is scattering infrared radiation emitted by the Earth, and such radiation is emitted day and night. Let me explain this:
All objects emit a type of radiation called black body radiation. And the color (wavelength) and power of that radiation depends on temperature.
This radiation becomes evident to the eyes only at temperatures above 500 °C, when stuff start to glow, as amber, the heating element of a stove, the filament of a incandescent light bulb, or the Sun itself. However, this radiation is emitted also by colder objects, as the human body, the ocean and even glaciers and ice cubes. But we can't see that radiation because is very faint and mostly composed of infrared radiation that is invisible to the eye.
However it can be detected with cameras, and that's why military and surveillance thermal infrared cameras are capable to see in the night, because they see the radiation the human body emits. Here an example:
[picture from Videoblocks]
The interesting fact to keep in mind, is that for Earth to be in thermal equilibrium (meaning that the mean temperature is stable or changing very slowly), the amount of infrared radiation that Earth's emits have to be equal to the amount of radiation it receives from the Sun, so it is a lot!.
The effect of CO$_2$
Now, the effect of CO$_2$ is not to store any energy, it just blindly absorb and re-emit infrared radiation (foot note 1), there is no significant storage. The key point is that most of the infrared radiation it absorbs comes from the surface, and then it re-emits it in a random direction. As consequence of this, half of the radiation that was escaping to space is sent back to the surface, and that's the origin of the warming effect of CO$_2$.
So the effect of CO$_2$ is similar to that of a survival blanket like this one:
[image from Aliexpress]
This blankets don't produce or store heat, it is not good insulators either. This blanket just reflect back some of the infrared radiation that is leaving the body, effectively keeping it warmer. That's the same effect of greenhouse gases.
Let's imagine an atmosphere with no greenhouse gases. The radiation balance would look like this:
In this case the equilibrium temperature of Earth would be that on which the outgoing energy is equal to the incoming energy. That equilibrium would happen when the Earth's surface is at -18 °C, because at that temperature (according to Stefan-Boltzmann law that say that emitted energy $=\sigma T^4$), in average, the black body radiation of Earth's (working day and night) would be powerful enough to equal the amount of energy we receive from the Sun during the day. So in this scenario Earth's mean temperature would be a freezing -18°C (like in the Moon).
But thankfully we have greenhouse gases, and the actual radiation balance of Earth looks more like this:
Here, half of the energy radiated by the surface is sent back to the surface by greenhouse gases (as a survival blanket does). This effect (greenhouse effect) warms up the surface. And it will warm the surface up until it emits enough energy such that the half of it that can actually escape to space is enough to equal the incoming radiation and reestablish the balance. Does that make sense?
In this simplified scenario that balance would happen at a nice and warm 30°C. Now, if we have too much geenhouse gases, this heating effect will overshoot and we will be too hot. That's what have people worried about: we are putting too many "blankets" on Earth.
1.- As a Chemist you might be interested that this infrared absorption capacity is related to the asymmetry of the CO$_2$ molecule and it's associated vibrational modes).