CPU coolers are pretty complicated in terms of actual physics, but they aim to fulfill one single purpose and that’s to dump as much heat out of the CPU as possible. CPU coolers achieve this in a couple of ways.
There are some basic physics to understand if you want to know exactly how CPU coolers work. Heat dissipation is performed via three main methods, conduction, convection, and radiation. Most CPU coolers use at least one of the three methods at some stage throughout the cooling cycle, even liquid coolers.
Heat moves from the CPU to the cold plate, then through the heat pipe, the heat is transferred to the heatsink. This is where, with the aid of a fan, the heat is dissipated into the air around the heatsink.
This is a very simple explanation of how CPU coolers work and we have one far more in-depth in our “Best CPU cooler for Ryzen 9 5900X” article.