The engine shutting down could be triggered by a faulty crank position sensor. Malfunctioning crank sensor will send error codes to the ECM and that can trigger shutdown. After that the engine may or may not restart.
Another possibility is a bad coolant temperature sensor. The temperature sensor can send signal that the engine is 'too hot' and that can shut the engine down as well.
What codes are you getting with the check engine light? Typically, if the issue is not taken care of the light will come back on.
I have attached diagrams for your reference.
Please let me know if you have any questions.
Images (Click to enlarge)
Saturday, October 30th, 2021 AT 9:36 AM