I am well aware of "car died" at the light moments - had that happen in pouring rain - and no way to tow it out of the lane of traffic it was in. Had to push it - with no flashers or any lighting of any kind.
Having it happen the first-time places you in shock, but the next time, it's a little easier to tolerate and your senses are more aware of what happens in these moments.
Now that you are past the "panic" phase - you can then go forward with the instinctive responses - as to what works and what won't. So now you are better prepared to react - and more smartly.
That is where you need a clear head - so that you can look and find the things in the vehicle that still work that gets you out of harm's way.
Ok, first time this happened - did you check to see if Brake lights from your car - can you see them reflecting off anything in your rear-view mirror?
Looking around to see what still works - this can help you determine if the battery cable is loose and left you stranded - then you just have to find a safe spot to get out of the way and find a method to put the car out of park or into neutral and roll it off the road - you had this happen once, so you know what to do next time, and better than before.
Now the above may see a little "direction-less" but its due to the LACK of information we can use to help guide you.
You got the car started and you're worried that the car will die again.
So that leaves us little to work with except to offer the advice that you have to keep your wits about you - keep the panic level controlled - you'll be ok, you got this far. We need to know what still works - for the battery can die in mid-drive, but the engine will still run because the charging system is powering what's left even though it won't accept charge.
But when you have a catastrophic failure - the fuses blow, and to know what works or still works, can help us in finding your cars fault that made this mess.
Ok, road debris can get kicked up - parts can shake loose and fall - so what caused this may not be what we need to know, but what it did - does.
I can think of the starter motor - having exposed wires - might have had a loose part lodge between it and the wire from the starter cable - this can cause a pinch point and a short - which pulls down all the power the charging system has to deliver - and will flow into and thru that short - preventing power from going to the engines ignition - so this will blow a fuse on the batteries main terminal block post. you lose power but the system is saved from self-destruct by that fuse blowing.
Doesn't help you get the car started again.
So how did you get the car started again?
We are only mentioning one scenario - there are numerous others and those are just some rabbit holes we can go down but does little to instill faith in the product that left you stranded and questioning like this.