You start with the basics to determine if yo have a fuel supply problem or an ignition problem
So get yourself a pair of red in line spark testers and fit one to each spark plug ties up so you can see them easily from the drivers seat
Get an alternative fuel tank , pinch one off an old push mower anything.
Tie it to the back of the seat or if you have ROPS, hang it from the top rail ( so you will need some 1/4 fuel line & a tap ).
Hook the fuel line directly to the carb.
Then go mow
If you run the tank dry with no problems then suspect fuel system
If the red spark testers stop flashing then suspect a safety switch
With these sorts of problems it is a case of elimination
Do this get back with the results & we will take it from there
Otherwise every one has that "pet" problem that happened with Uncle Freds mower and they will be dead sure it must also be your problem.
The spark testers were around $ 18 last time some one costed them
$ 10 for some fuel line & $ 6 for the tap.
FWIW I use an old Tecumseh 12 Hp tank as it came with a tap & the engine was very much deceased .
Do not do the tank cap up very tight.
Another friend uses an old motorcycle tank of his little kids Pee Wee
A half gallon should run that motor for about 1 hour and a quart is more than enough if it starts to falter after a few minutes .