2006 Pontiac G6 slows but doesn’t stall

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.

There may be a problem with the accelerator pedal position sensor.