I was trying to replace the cooler with another and when I take off the cooler the CPU was stιck on it.
When I was trying to pull out the CPU one pin broke and I lost it.
If I try to stick a pin from another CPU will work?
You will most likely fail since the Pins are very thin and fragile. Install the Ryzen again and see if you have any problems while booting up and while running your computer in General.
The Pin could just be a redundant pin and may not affect the CPU in its regular usage. If the pin is important and does affect the operation of the CPU, then you are out of luck. You will need to purchase a new CPU. AMD doesn't cover broken or bent CPU pins in its Warranty.
Try looking up in YouTube and see if anyone has an alternative method of replacing the broken pin. I have read about installing a small pin in the same socket hole as the broken CPU pin to make contact. But you need to google that or use search in YouTube to find out how that is done. Keep in mind you may damage your Motherboard by doing so.
Retrieving data ...