On some engines, there is a solenoid that is energized to allow fuel flow and on others, the solenoid is energized (momentarily) to stop fuel flow and stop the engine.
It's important to know which system you have before you begin troubleshooting.
On the first, turning the key energizes the solenoid and allows fuel to flow. You should have 12 volts at the solenoid when the key is set to "run".
On the second, you should have 12 volts at the solenoid when the stop switch is activated. This is what I have.
Troubleshooting is as follows:
You need 12 volts at the switch (measured to ground or negative).
When you press or turn the switch, you should have 12 volts at the other terminal of the switch.
When you press or turn the switch, you should have 12 volts at the actual solenoid.
Disconnect the wire from the solenoid and measure the resistance from that terminal to ground. You should have a few ohms (five or so). If there is no resistance (infinity), the solenoid is open (burned out).
On my engine, everything checked out but the engine wouldn't stop. I suspected that the solenoid was being prevented from moving for some physical reason. I tried to remove it but stuff was in the way and fuel was leaking out. I screwed it back in, and reconnected the wire, figuring I would work on it another day.
It has been working fine ever since and this would be a hundred or more engine shutdowns and a couple years.