Most magnetos have two windings, the primary blue and an auxiliary white wire.
Both are tied to a common motor ground.
Shorting the Aux white wire kills the motor by magnetic resistance in the mag stalling the motor at idle, this is why you don't want to use the white wire for powering anything.
Shorting the Primary blue wire robs the CDI of power and creates magnetic resistance in the mag and no spark.
Or you can simply put a switch in series with the Primary blue wire, just open the switch and no power to the CDI and no stress on the mag.
I cut all 3 wires off at the mag and run some better wire to the CDI, tie the kill button there, then top it off with a little plastic hobby box.
On some I put a keyswitch in the that plastic box which works as a spark cut-off as mentioned and disables the bike from starting.