Answer:
Mary should first purchase a compatible CPU. Afterwards, ensure the machine is powered off and unplugged. She now needs to open the computer case, unscrew and remove the CPU fan, and remove the old CPU. This can be done by gently unlatching the socket lever and lifting the old CPU out of its socket. Afterwards, align the new CPU, drop it in and latch the socket. She should now apply thermal paste and screw back on the CPU fan.
Cooling is a concern as it affects the performance of her CPU. If heat is unable to dissipate fast enough, the CPU will limit its own performance in order not to damage the parts through overheating.