An EV won’t just stop without advanced warning. Drivers get plenty of warnings when the battery runs low, and if it’s low enough, the car will reduce propulsion power. When running low on battery power, many EVs will display the closest public chargers and guide you there.
If your EV completely runs out of charge, AAA has a mobile electric vehicle charging program (trucks with built in EV chargers) in many areas.