I'm Chris, Thanks for allowing me to help you here on Just Answer.
So far you have described a faulty idle air control valve which controls the engine idle rpm. It is mounted o nthe throttle body on the top of the engine. I recommend you start by replaceing it.
Did you reset the PCM by removing the negative battery cable for 5 minutes. if not try this then get back with me.
Also check for vacuum hose or PCV hose leaks.