Engine occasionally shuts off no warning

This has been a problem since October, although it only happens a few times a month it has left me stranded in the middle of the road twice. The engine will shut off and lately my solution has been putting it in park and turning off the car then starting it up again. Recently, it happens when I am stopped at a light but still in drive. Car is a preowned 2009 hyundai sonata with a slight coolant leak that doesn’t cause problems. Battery, oil, and engine light will all come up when the engine shuts off, but go away once it’s turned back on and my bf says they are working fine when he checks. I’m starting a new job as a nanny and the family would like for me to take the kid places, but I’m unsure because I don’t know if this problem could become a bigger issue. Any ideas of what it could be?