When I turn the key it works fine but during idle it will start to die off and eventually die out it turns back on instantly. While driving it's fine but sometime at stops it will want to dies out. I have some ideas of where to look but would be helpful to pinpoint the exact location
My car has 240000 miles.
My car has an automatic transmission.
It sounds like you may have a dirty or failing idle air control valve. The idle air control valve monitors the air intake as it is mixed with fuel prior to being injected into the engine at low speeds and at idle. This valve is controlled by the vehicle’s computer and will adjust idle speed based upon other measurements such as engine temperature, intake air temperature and electrical system load or voltage. This is also an important function when starting the motor as it allows the motor to run and idle on it’s own once the motor fires. When you accelerate, the engine RPM increases, and as you let off the gas, the RPM slowly returns to the normal idling speed with the help of the idle air control valve making the transition from a higher RPM back down to idle speed while adjusting the air/fuel ratio constantly to allow this to happen smoothly. When the engine RPM drops below the normal range of about ~800 RPM, this often times will cause the engine to stall indicating a dirty or faulty idle air control valve. I would recommend having an expert from YourMechanic come to your location to diagnose and replace your idle air control valve.