Fuel pump failure: A failing fuel pump can cause the engine to stall out while driving.
Electrical problems: A loose or faulty electrical connection, such as a bad ground wire, can cause the engine to shut off.
Sensor problems: A faulty sensor, such as the crankshaft position sensor or camshaft position sensor, can cause the engine to stall out.
Computer problems: A problem with the engine control computer (ECU) can also cause the engine to shut off.
To diagnose the exact cause of the problem, you will need to have your car inspected by a qualified mechanic.