Changing the compressor isn't hard BUT (1) to be legal you need to have someone evac the old refrigerant first and (2) you NEED a vacuum pump to properly pull a vacuum before recharging, plus a set of manifold gauges and a gram scale to get the proper amount into the system (these systems are charged by weight and you cannot get the correct charge simply by using pressures.)
DO NOT loosen any of the hoses or such with a charge in the system! Not only will the refrigerant vent explosively and it's very illegal to vent the refrigerant to the atmosphere it will also undergo very rapid adiabatic cooling and if it gets on your skin can produce very serious frostbite. In or around the eyes that damage can easily be permanent. Oh, and it's quite toxic too on top of that.
In addition you need a dryer (any time the system is opened) and you *should*, if the compressor is replaced, flush the lines and condenser/evaporator with solvent and then oil-free DRY air (e.g. from a scuba tank or similar) to make sure they're completely clear of any crud and (especially) old oil, as a new compressor will have a full charge of oil in it. Don't get the old oil out and you are massively over-oiled which can cause serious trouble (at minimum it will make the unit run with less cooling) and, if there's any moisture or crud in there, you run a high risk of it destroying the new compressor too.
Pulling a hard vacuum for at least a half-hour (an hour or more is better) is essential as the refrigerant will combine with moisture and produces an acid that will eat the system. Pulling a hard vacuum causes any moisture in the air (or residual solvent you use to clean the lines and both evaporator and condensor) to boil off and thus be removed. Best practice is to pull all the way down, isolate the valve and leave the system for at least 30 minutes to verify there are no leaks (if the vacuum doesn't hold there is) and then turn the pump back on and let it pull for at LEAST a half-hour before charging - 1-2 hours is even better. The point of that is to make sure absolutely ALL of the moisture and any solvent is out; under hard vacuum essentially any such stuff will evaporate and be pulled out by the pump.
If you already had a leak and the system is empty then a flush and hard-vacuum pull is ESSENTIAL, and a new dryer ALWAYS is, and don't take the plugs out of the new dryer until you are about to connect the lines on both ends. If you don't do it your new compressor will likely only be good for a few months -- if that long.