The ignition coil on your lawn mower, just like the one in your car, acts as a transformer to transfer and increase voltage from the battery to the spark plug. When you start your lawn mower, the battery sends a quick charge to the magnetized coils in the ignition coil. The charge travels through the coil to the spark plug, creating a spark in the gap on the plug to ignite the fuel. Testing the ignition coil itself requires special equipment, but you can test its functioning by process of elimination.
Consult the owner's manual for your mower and follow the recommended safety precautions before proceeding. You can find manuals for most mowers on the Internet if you don't have a copy of the manual for your mower.
Remove the spark plug and insert the tip of the screwdriver into the clip that was holding the spark plug.
Hold the insulated part of the screwdriver to position the metal blade 1/8 of an inch from the mower's block or frame. Putting the screwdriver in this position simulates the gap on the spark plug.
Have an assistant crank the engine at a normal starting speed while you hold the screwdriver in place and watch the gap. You need someone else to start the mower so you can keep the screwdriver steady and be close enough to see what happens. Watch the gap carefully to observe what happens when the engine is cranked. If you see a spark, you may need to replace the spark plug, but your ignition coil is working.
Check the stop switch for damage or loose wires. Verify that the switch is set correctly to operate the mower.
Verify that the flywheel is responding to the starter and turning freely. It should be tightened enough to be properly seated, but not so tight that it is scraping.
Trace all wires and connections to see if there is damage or a poor connection. If the lawn mower is wet, let it dry out to see if moisture was interfering with a connection.
Repair any problems detected by the preceding steps. If the mower is still unable to produce a spark, you can conclude that you have a problem in the ignition coil. Testing an ignition coil itself requires special equipment and may not be cost effective.