If the car can’t crank, I would check the battery voltage. If the battery is dead your car would shut off. With the car off you should have 12 volts. If you have less then 12 volts there are two reasons why this could happen. 1 the battery needs to be replaced. 2 The alternator is not generating power while your car is on. You can check this by charging your battery to full capacity. After the car is running you should have 13 volts or more if the battery is fully charged when running.