2013 Ford Focus loses power

I have a 2013 ford focus hatchback, SE with flex fuel. Over the past 2 weeks when ever I’m driving about 35-40 mph when i take my foot off the gas the RPMs drop and in most cases, I lose power.
when I’m at the gas station to fill it up. I start the car and it immediately dies. I start it again , then it idles.
Can you help me I’ve changed the O2 sensor twice. and still get a check engine light after 20 to 30 miles.
Thank you.

Faulty throttle position sensor, or a very dirty throttle body - wreaking havoc with a sensor, such as Mass Air Flow, Mass Air Temp, Mass Air Pressure.
Or one of the sensors listed above.