The purpose of an air conditioner compressor is to compress the refrigerant gas that comes from the home from low to high pressure and deliver it to the condenser, which turns it from a gas into a liquid form. The compressor and condenser are located outside the home and when issues with the compressor begin to arise it causes a higher electric bill, shutting down of the air conditioner unit or lukewarm air instead of cold air. There are several ways to detect if your issues are due to a bad compressor.
Use your hand to check the compressor fan air. If the air coming from the fan is cool or lukewarm, then the compressor is bad or worn. When the compressor compresses the gas to high pressure, heat is created and expelled by the fan to make sure the unit does not overheat. If the air coming out is cool or lukewarm, then the compressor is not compressing the gas.
Keep an eye on your electric bill. If you electric bill begins to climb and you haven't had an increase in air conditioner usage, the compressor is likely bad or worn. If the compressor is not compressing the gas enough, then it decreases the efficiency of the unit as a whole. It causes the air conditioner to run longer and thus will increase the electric bill.
Listen to the unit when it turns on. When you listen to the outside unit, you will hear the smooth running of the compressor and the compressor fan. If there are problems with the compressor, you may hear a hissing caused by refrigerant gas leak, a knocking sound if the compressor motor isn't working correctly, and an extended period of time for the unit to start up.