The Yard Machine lawn mower's carburetor uses vacuum pressure to bring fuel from the tank into the carburetor. The diaphragm in the fuel pump pulses with the crankshaft and squeezes more fuel into the tank. However, the pressure inside the tank needs to be less than the pressure inside the carburetor for this process to work. When a fuel cap can't vent the pressurized gasses inside the carburetor, the engine may surge and eventually stop. Clean the gas cap's vent hole, in the center of the cap, or replace the fuel cap.
As the fuel flows from the tank to the carburetor, it must pass through a filtration system to get rid of any particles that might scour the bore inside the chamber. This filter, if partially clogged, will cause the engine to suffer idling problems. This occurs usually when a piece of grass or dirt got dropped into the fuel tank. As the object floats around inside the tank, it will eventually get sucked up against the filter. Clean the fuel filter after every 15 hours and replace it seasonally.
After the fuel leaves the tank, it travels through the fuel hose to the carburetor, while any unused fuel from the last cycle gets dumped back into the fuel tank via the purge hose. If either of these hoses gets blocked, the result will be a drop in fuel that can cause the mower to suddenly idle up or down. These hoses can get clogged from debris that's small enough to pass through the filter. Impurities in the fuel will also eventually clog these hoses. Replace the fuel hoses every other season.
When the fuel reaches the carburetor, an inlet needle opens a lever, allowing the fuel to pass through the main bore and jet. A partially clogged jet or bore will also cause idling problems, such as surges. The lever on the carburetor can also get stuck partially open, if the inlet needle gets stuck. When cleaning the rest of the fuel system can't solve the problem, take the carburetor out of the engine and disassemble it. Clean the inlet lever and needle with carburetor cleaner and make sure they get reseated properly during assembly.