Correcting backfire in an engine may be as simple as changing the shutdown procedure. Several manufacturers recommend turning the speed or idle lever to slow or low for a few seconds before turning off the mower, to prevent buildup of fuel that might backfire. An engine that backfires during operation and also runs poorly or erratically, however, may need additional troubleshooting.
Check the fuel supply; gasoline can degrade within 30 days and cause erratic performance. Drain the tank and put in freshly purchased fuel; put the drained gas in your truck or car where it will be diluted enough to burn. Try gasoline without any alcohol additive; those additives burn more easily and can induce backfire. See if an air vent in the fuel cap is clogged. Check the fuel filter if there is one attached to the inside of the cap.
Remove the spark plug wire and unscrew the plug. If its electrode is burned or fouled with oil or grime, replace it with a proper plug, with the correct spark gap. Make sure the plug wire is not damaged and makes a solid connection with the plug tip and does not vibrate when the engine runs; a loose plug wire can cause erratic performance.
Take out the air filter, which usually is in a can on top of the carburetor. Engines must have consistent airflow to operate properly. If the filter is greasy or dirty, clean it or replace it. Many mowers use foam rubber air filters that can be washed in warm soapy water and air-dried. Replace one that won't wash clean. Replace air filters made of paper.
Clean the carburetor while the air filter is off. Spray it inside and out with an automotive carburetor cleaner. Make sure the connecting links on the outside, which control the throttle and choke mechanisms, are not damaged or so clogged with dirt they will not move freely. Check the muffler to make sure it is not clogged; a gasoline engine must be able to exhaust burned fuel.