If the window air conditioner's compressor and fans are running but the air conditioner isn't cooling, possible causes include a failed compressor or the lack of refrigerant due to a leak in the sealed system.
If the compressor isn't running but the fans work, the start relay or compressor might have failed.
A defective electronic control board or control thermostat could prevent the window air conditioner from cooling.
If the window AC compressor is not staying on, then the compressor is likely overheating.
Follow these steps to prevent the compressor from overheating:
Clean the condenser coils so refrigerant cools down properly when the compressor runs.
Check the condenser fan blade and replace the blade if it's damaged.
Clean all air vent slots in the window AC cabinet to maintain cooling air flow going to the compressor.
If the window AC compressor is not staying on after following these troubleshooting steps, then you may need to replace the compressor.