The fan should be attached to a metal heatsink that sits on top of the CPU, with a thin layer of thermal grease (also called thermal compound, thermal paste, heat paste, heat sink paste, heat transfer compound, or heat sink compound) between them.
Since you didn't tell the make and model of your CPU, I'll guess that you will have to loosen the 4 nylon pins (newer Intel CPUs), or lift the two levers (AMD processors and older Intel CPUs) that actually hold the heatsink firmly seated against the CPU. Once that is done you can lift the heatsink and fan assembly from the CPU. If the heatsink and CPU are stuck together, gently twist the heatsink to loosen it from the CPU, and then lift the assembly from the CPU. You can then unclip the fan from the heatsink.