My main thought was the battery needed replaced but I charged it up and same thing I looked up a few reasons why it would do that but no clear answer was given
My car has 217000 miles.
My car has an automatic transmission.
The brake booster is supplied vacuum from the engine and if it is leaking vacuum when you push the brakes, then the booster may need replacement. I recommend having a mechanic diagnose the vacuum booster for the brakes and also check the charging system and battery. If you have to keep charging it up, it may not have enough power to keep the engine running and the brake pedal turns on the brake lights that causes the power to the engine to be too low resulting in engine stalls. This would explain the recharging of the battery you had to do. If you need help resolving this problem, a certified technician from YourMechanic can come to your car’s location to diagnose your stalling issue and come up with the correct repairs.