By hitting them!
A CO2 molecule in the atmosphere, after having absorbed an infrared photon, is vibrating or rotating more vigorously than it was before. When such a molecule collides with a neighbouring molecule (most likely an N2 or an O2) some of that vibrational energy contributes to the speed or vibration or rotation of the one it hits.
The atmosphere doesn’t continue heating up though, because in the equilibrium situation the molecules in the atmosphere collectively emit radiation at the same rate as they absorb it. But they do this equally in all directions, so what they are absorbing from below gets re-directed and only half of it ends up going outwards (with the other half going back down to warm the Earth’s surface).