Could be a vacuum leak. The year and engine info would help us help you.
sounds like a bad idle control sensor
An engine usually has a higher idle speed when the ac is running. If the high speed idle does not operate then the ac will cause the engine to stall.
the engine to stall and surge at idle
It can if it sticks open at idle.
Fast idle motor defective.
A very low idle can cause a 97 Ford Taurus to stall. Another reason for stalling may be transmission bands sticking, which does not allow the transmission to come out of gear on idle.
vaccum leak
If the car is starving for fuel or air (low power at idle), the car will stall while turning.
Idle slows down to a stall when you stop or slow down when AC is running. How do I adjust idle or is something else wrong?
Your car may stall or stop running after idle because of a problem with its fuel or electrical system.
An idle motor controls the idle-like when U turn on the AC,It will raise the RPM's so the engine doesn't stall. Idle motors are used on computer cars & instead of a screw adjustment.
Usually, a jeep's engine stalls in idle mode because of a battery power fault or because there is no gas. However, it is common for any car to stall when it has not been running for a period of time and the engine is cold.