There's a solinoid in the transmission.Suggest to check that first. Turn on interior lights. Start engine. If the lights go out when the engine stalls, you have a bad ignition switch.
It sounds like your alternator is no longer recharging your battery. You probably need a new alternator.
There is most likely something in the gas tank. When the car starts the fuel pump starts sucking in fuel and when the trash gets to it the gas will not be able to flow through the clogged pump so the car stalls. When it stalls the fuel pump stops suction and the trash comes out allowing it to start again.
my suburban wont start
car starts but shut off while driving
Sounds like it is not charging, have the charging system tested, it may be the alternator at fault.
the idle jet in the carb is blocked and needs to be cleaned out and reset
Possibly Crankshaft Position sensor
Idle Air Control Valve.