On a 2006 Pontiac G6 the engine slows just idles but don’t stall and I have no power I would that be
Sounds fuel related. Throttle body, fuel pump, throttle position sensor if it has one. Is the check engine light on?
Dirty throttle body is pretty likely. Spray cleaner specifically for throttle bodies is available at the auto parts store.