Start by disconnecting the kill wire from the magneto
Note that doing this you will have to pull the spark plug off or cut the fuel off to stop the engine
Problem goes away = bad kill switch or wires between kill switch & magneto
Drain the tank & check for water
If this does not work, get a red inline spark tester and hook it up to your engine
IF the element stops glowing red or flashing irratically then the engine stops you have an electrical problem
If it flashes right to the bitter end you have a fuel problem
Check the valve lash
flood around the manifold with WD 40 ( or similar ) from a trigger pump pack, not a spray can .
Have a good look at the plug
If it is carbon fouled then it could be the choke remaining open although this usually does not make an abrupt stop but a splutter stop .