Start with replacing the fuel filter, it may be plugged.
It sounds as if the fuel filter is clogged and not getting enough fuel to the injectors.
There are multiple things that could cause this, your best bet it to take it to a mechanic and let them check it out.
TCC Solenoid.
Could be a fuel pump going bad or a clogged fuel filter,
They start to sputter,stall and stop running.
how to in stall a Quarter Window in a 98 Chevy blazer
coz you shud of gone to specsavers
FUEL PUMP IS YOUR PROBLEM {why do you think its the fuel pump?}
A faulty muffler will not cause this but a clogged catalytic converter will.
Check your voltage regulator and alternator. You're getting enough juice to either run the engine or the lights but not both.
It sounds like your engine is not getting enough fuel, try checking the fuel filter.
Look for a hole in the PCV valve hose on the backside of the engine.