The AC compressor is driven by a belt attached to the engine. Its job is to compress the working agent before it is decompressed in the evaporator. During decompression, the evaporator is cooled together with the air flowing around it.
The compressor is equipped with a few pistons which compress the working agent, forcing it to circulate. The compressor is lubricated by means of the oil contained in the working agent. The V-belt pulley of the compressor contains an electromagnetic clutch, which switches the compressor on an off when needed. If it fails, the compressor has to be removed to be repaired or replaced. This requires opening the AC pressure system, hence before you commence the procedure, make sure you suck the working agent out of it.
Next, you should disconnect the low and high pressure hoses. Next, loosen and remove the drive belt from the pulley. Then remove the compressor mounting screws. Remember that a faulty compressor may have contaminated the AC system with metal chips, so just repairing or replacing it will not suffice. You have to flush the AC system and change the dryer filter and the expansion valve. Before fitting a new or reconditioned compressor you should put a small amount of lubricant into it through a special inlet or through the suction port.
The compressor is fitted back in place in the reverse order. After you connect all hoses by means of a special tool, spin the compressor shaft a few times in order to evenly distribute the lubricant. Next, fill the AC system with the working agent and the lubricant. Finally, switch the AC system on to check if it functions properly.