My bet is a sticky/dirty idle air controller. Attached to the throttle body, the IAC is what provides all of the engine's air at idle when your foot is off the gas. When it sticks, the engine can't get enough air at idle so the engine will either idle poorly or die whenever you're not stepping down on the accelerator pedal to let air into the engine.
Buy a can of aerosol throttle body cleaner and with the engine running, clean the throttle body's interior using the instructions on the back of the can. Get as much of the cleaner into the IAC's air passage inlet slot above the butterfly valve plate as you can, that is how the air gets to the IAC and how to get it cleaned. The engine will die as you squirt cleaner into the idle air control passage inlet but that's ok, just restart the engine when that happens.
If this doesn't clear the problem entirely, the IAC is only held onto the throttle body by two small torx screws which means the IAC can be easily removed and cleaned with a soft brush and the throttle body cleaner. Clean the hole its plunger fits into too. Don't push/pull/spin the IAC's plunger.
This is an easy one-banana job.