next time it sputters and dies.. or when it's not starting, remove the plug and look and see if it's all wet with fuel. If so you have some kinda carburation trouble.. too much fuel is getting in.
It might not be easy to start with Starter Fluid if the plug is already wet and the carb is still dumping more fuel into the engine while you're starting..
If it eventualy starts and runs you can be pretty sure the ignition is ok.. and that the uneven running, sputtering and dying and hard starting are all related to some carburation or fuel-supply problem.
Sputtering before it dies is more likely to mean the engine flooded out rather than it ran out of fuel. The engine might surge to a higher RPM and then die when it runs out of fuel. But who knows.. Pull the plug. If it's dry as a bone it might be running out of fuel. Why is the question. Trace the entire fuel pathway from gas tank to engine and find the obstruction.
Check for loose nuts / bolts that allow vacuum leaks around the carb. Adjust the carburetor and it's cables.. be sure the choke opens and closes like it should, etc. Do all the fuel-related tune up checks. "Search" this forum and use the "Resources" for ideas about what to check.. Read "Fred's Guide".
Carb problems and your symptom are very common. I think a thorough fuel-system tuneup will find and fix it.