2005 Ford Escape V6 issues?

My 2005 Ford Escape V6 has been rough idling. Sometimes when i'm accelerating it stops for a split second and the RPMs drop then they resume at the right power. The rough idles were getting to the point where I thought the car was going to die at times so I changed the plugs. That didn't work and today the vehicle died while I was accelerating from a stop. I turned it back on and proceeded to drive home, operating normally. I'm sure this could be a number of things but what would be the most common causes? I also have a pretty new battery in it.

Perhaps unrelated but also, the headlights and dashboard lights flicker. Iv read perhaps it's the alternator?

You really need to do a diagnostic. There's too many similar sensors and parts that could cause this. You need to isolate which one. Then expect a cascade failure, if sensors. Unless it is simply a failing fuel filter? You need those codes.

You mentioned lights flickering. That gives a clue that it's electric in nature, so there's an excellent chance it is indeed the alternator.