When you use a lawn mower you are constantly dealing with flying dirt and debris. On top of this, when servicing it or filling it with fuel you're often in a dirty environment. Dirt in the fuel system causes numerous problems that lead to an engine that stalls or runs poorly. Carburetors often flood as a result of dirt in the fuel tank, for instance. Always ensure that the area around the fuel cap is clean to prevent dirt from entering, and clean the in-line fuel filter or install one if the lawn mower doesn't have one.
Dirt also affects other parts of the engine. Air filters on lawn mowers get clogged, and if they do the result often is an engine that runs poorly. Check the mower manual to determine if the filter can be cleaned or is a paper filter that must be replaced. Keep a spare filter on hand and try replacing the old one if the mower is running poorly. After proper airflow is restored, the problem may be fixed.
If the engine seems to sputter or surge, the problem might involve the carburetor. Drain the gas from the mower and remove the bowl from the bottom of the carb. Wipe out the bowl and thoroughly clean the nut with carburetor cleaner. Ensure that you clean any tiny pinholes in the nut. Reassemble the carburetor. If the problem remains, rebuild the carburetor.
If you're experiencing a motor problem when using a mower for the first time in the season or after letting it sit for more than a month, the problem might be as simple as old fuel. Drain the tank and refill it with new gas, and the engine should run more smoothly. If you know the mower will sit for some time, add a fuel stabilizer to avoid this problem.