After you find out your model number do a Google search or your preferred engine asking ” what cpu’s are compatible with (insert motherboard here)
After you find out then pick the compatible cpu of your choice. I wouldn’t recommend buying used as you don’t know how they have been treated. Most new cpu’s will come with a stock fan and heatsink. ( this is the large fan on your computer connected to the motherboard.)
If you buy an OEM/Tray (meaning just the cpu no fan or heatsink) you will need to buy an aftermarket CPU cooler and thermal paste ( a YouTube vid can teach you how to apply this)
After you get your cpu and fan unplug your computer, make sure you’re grounded and unscrew the 3 or 4 screws holding the fan and heatsink in place and then remove the cpu itself.