If working on a 2 cycle you block off the exhaust behind the muffler, block off the intake behind the carb. Use a mityvac to check pressure and vacuum of crankcase, never exceed 7 pounds of pressure or vacuum. Crankcase if sealed should hold pressure and vacuum.
You can have leaks around the sparkplug, intake manifold, crankcase gasket, crankshaft seals. If 2 cycle won't hold vacuum then pressurize crankcase and submerge crankcase in some liquid like parts solvent and look for bubbles.
4 cycle there is a special gauge to determine how much is leaking in percent of loss compared to input pressure.