There are many videos on YouTube showing how to repaste a CPU, but before you consider this task, have you checked if something else is causing the overheating?
Where I live we're having a small heatwave. Not particularly hot, but if your system's cooling is not ideal, it can overheat in hot weather.
Remove the side panel from your computer and shine a torch (flashlight) down through the fan blades on your CPU cooler(or radiator) and check for dust embedded in the heatsink vanes. If the heatsink looks dusty, get rid of the muck.
Also, consider increasing the speed of your CPU cooler's fan, by changing the profile in the BIOS.
If you must replace the TIM (Thermal Interface Material), otherwise known as heatsink paste, run your computer for 10 minutes to warm up the CPU. It can make removing the heatsink easier and soften up the paste.
If the heatsink doesn't come away from the CPU easily, try gently rotating the heatsink back and forth through a few degrees. I have ended up with the CPU coming out of the socket, still attached to the heatsink, when the paste has refused to let go. Not a good idea.
Clean the TIM with a lint free cloth or paper towel plus a splash of IPA (alcohol) off the heatsink and CPU. Squirt a small pea-sized blob of TIM on the centre of the CPU. Re-attach the heatsink and tighten screws on alternate corners. The small blob of TIM will spread out over the CPU, creating a nice thin layer. Do not use too much TIM. It reduces cooling. If TIM oozes out around the edge of the CPU, you've used too much.