If the compressor on your cars air conditioning system has failed or the system is contaminated, the entire system will need to be flushed with an approved A/C cleaning solution.
When the compressor fails it contaminates the air conditioning system with metallic debris. Most of the contaminates collect in the condenser which then leads to blockage reducing your cooling performance. If the debris passes through the condenser and gets into the liquid line, it most likely will plug the expansion valve and orifice tube. This can reduce the flow of the lubricating oil and refrigerant resulting in compressor damage and loss of cooling.
If sludge is found in the A/C system it means there has been moisture contamination. The sludge looks like a thick black liquid and can plug the expansion valve or damage the compressor. The receiver drier is supposed to prevent moisture contamination from happening. The drier can only hold so much moisture and once it is saturated sludge begins to form. When flushing the system it is a good idea to replace the drier.
Another good reason to flush your ac system is if you are changing your coolant from a R-12 to a R-134a refrigerant.
Once the flushing is complete it is a good idea to install a high side filter to your system. This will protect the expansion valve and orifice from any debris that might remain in the air conditioning unit.