Every part of a gaming PC that does work turns electricity into heat, and the processor (CPU) makes the most of it. A CPU cooler's only job is to move that heat away fast enough that the chip never has to slow itself down. Pick one that is too weak and you pay for a fast CPU you can't fully use.
The CPU sits under a metal lid. A flat metal plate on the cooler presses against that lid with a thin smear of thermal paste in between, and the heat flows into the cooler. From there it has to reach the air in your room. Fans push air through metal fins or a radiator, the air carries the heat out of the case, and that is the whole trick.
The CPU watches its own temperature. When it gets close to its limit (often somewhere around 95 °C, but it varies by chip) it lowers its speed on purpose to protect itself. This is called thermal throttling. You won't see an error. Your game just runs a little worse than it should.
A tower air cooler is a block of thin metal fins with copper tubes called heatpipes running up through it. The heatpipes carry heat from the plate on the CPU into the fins, and one or two fans blow air through them. There is no pump and nothing to leak. The main things that wear out are the fans, and those are cheap and easy to replace.
The catch is size. A good tower can be around 160 mm tall, and your case side panel has to clear it. Big towers can also sit close to your memory sticks and the graphics card.
An all-in-one (AIO) liquid cooler is a sealed loop. A pump moves liquid through a plate on the CPU, along two tubes, to a radiator that you mount on the edge of the case. Fans on the radiator blow the heat out. The number you see in the name, like 240, is the radiator length in millimetres: it fits two 120 mm fans. A 360 fits three and has more surface area to shed heat.
Liquid cooling doesn't automatically mean cooler. A small AIO can lose to a good tower. What it does give you is a small block on the CPU, so there is more room around the socket, and room to put more radiator surface in the case. The trade-offs are an extra part that can fail (the pump), a bit of pump hum, and a more fiddly install.
Choose a cooler, set how hard the CPU is working, and turn the fan speed up or down. Watch the temperature, the noise and how much speed the CPU has to give up.
You can often make a weak cooler cope by running its fan faster, and the sliders show what that costs you: the temperature drops, the noise climbs. A larger cooler moves the same heat with slower, quieter fans. That is the real reason to pay more. You are buying quiet, or headroom for a stronger CPU later, not just a lower number.
Three checks stop most mistakes. First, the socket: the cooler must list your CPU's socket (for example AM5, or LGA 1700 and LGA 1851 on Intel). Second, height: compare the cooler to the maximum cooler height in your case's specifications. Third, for liquid coolers, check which radiator sizes your case supports and where they mount.
Also look at the cooler's TDP rating, the maker's figure for how much heat it is designed to handle. It is a rough guide only, and different brands calculate it differently. But a cooler rated far below what your CPU can draw under load will struggle.
On a tight budget, a simple tower with heatpipes and one 120 mm fan handles most mid-range CPUs. Check the socket and case height, and don't bother with lighting. At the sweet spot, look for a bigger tower or a dual-fan design with a TDP rating comfortably above your CPU's power use and a fan that stays quiet at moderate speed. If you want to step up, a 240 or 360 mm AIO suits strong CPUs, small clearance around the socket or a look you like, as long as your case supports the radiator and you accept the extra part that can fail. For most people, a good tower is the safe choice.