A car can stop running while driving if it runs out of fuel or because of malfunctioning components such as alternators, fuel pumps, ignition switches or sensors. Drivers can attempt restarting the engine or gently guiding it to the side of the road if restarting fails.
Car engines can stall when driving for a number of reasons. In modern cars, faulty sensors can give the onboard computer the wrong information, causing it to set incorrect parameters which in turn could cause an engine stall. In most cars, this will result in the car's "check engine" light turning on.
Furthermore, anything that interferes with the engine's supply of air or fuel can cause a stall. This could be an obstruction in the system, a malfunctioning fuel pump or a clogged filter.
In the event of an engine stall, drivers should attempt to guide the car to a safe parking spot, turn on the hazard lights and call a professional for help.