The outdoor unit is frozenIf there's ice on the outdoor coil or the refrigerant lines, the system is almost always low on charge or short on airflow across that coil. A frozen coil can't pull heat out of the air inside the house, so the vents blow warm no matter how long the thermostat runs. Turning the system to fan only, not off, lets the ice melt without you forcing a compressor to run against a blocked coil. Once it's clear, a contractor can check the charge and find where it's leaking out.
It's stuck in heat modeThe reversing valve is what switches a heat pump between heating and cooling, and when it sticks, the outdoor unit keeps acting like it's January even with the thermostat set to cool. You'll notice the air from the vents feels warm instead of cool, sometimes even warmer than the room. This isn't something to force by cycling the thermostat over and over. A stuck valve needs a contractor to free it or replace it, since forcing the system can damage the compressor.