Turn off the power. Remove refrigerant. Disconnect electric. Cut or de-solder lines. Install compressor. Reconnect. Evacuate charge. A new suction filter is recommended.
You have to pump out and store the old Freon, solder the tubing back together after cutting the old compressor out, put in new Freon, etc. It takes specialized equipment.