Diagnosis
It's most likely overheating because the exhaust airflow is blocked, or the air intake filter is clogged.
How to Fix It
Clean the air intake filter first. It's behind the front grille. Wash it with lukewarm water, let it dry completely, and reinstall. A dirty filter restricts airflow, causing the unit to overheat and auto-shutoff for protection.
If That Didn't Work
Check the exhaust vent path again. Is the hose connection at the window loose, letting hot room air recirculate back in? Is the outdoor temperature extremely high (over 100°F)? Both can trigger thermal overload.
Heads Up
Let the unit cool down for at least 30 minutes after an automatic shutoff before trying to restart it. Forcing it on can damage the compressor.