If the compressor has become frozen or will not start even with the use of a "hard start" relay, then it will likely have to be replaced.
Because the compressor motor is connected to the refrigerant system, replacement is not a do-it-yourself project. Special equipment is required to disconnect the compressor from the refrigerant lines and then to reconnect it and recharge the system with refrigerant.
If you have reached the conclusion that the compressor must be replaced, then you should contact an appliance service technician to make the replacement.
Because compressor replacement can be moderately expensive and because it typically is required on older refrigerators, it is worth serious consideration to simply purchase a new refrigerator. If your refrigerator is a decade or more old, a newer model will like run more efficiently and save on energy consumption.