Replacing the refrigerator compressor can cost around $200.00 or more depending on the kind of refrigerator you have.
If it's a cheaper refrigerator that only cost around $500.00 then It would be better to just buy a new refrigerator depending on the age of the refrigerator.
If it's a high end refrigerator that cost $5,000.00 or more then you should look into replacing the refrigerator compressor.