See the How do I cancel a running Macro? user manual topic.
You can cancel all running macros by holding all the modifiers (Control, Option, Shift and optionally Command) and clicking on the Keyboard Maestro Status Menu Icon.
You can cancel a specific macro by choosing Cancel from the Status Menu menu and selecting the macro. This is also a useful way of seeing what macros are currently running, if any.
You can also see and cancel macros by choosing Start Debugging from the Status Menu menu.
And finally, you can use the Cancel All Macros, Cancel Other Macros, Cancel This Macro, or Cancel Just This Macro actions.
In desperation, you can quit the Keyboard Maestro Engine from the status menu, and you can launch the editor while holding all the modifiers down to quit all running engines and not launch the engine.