I'm not sure what a yts4000 is (a lawn tractor I assume). First disconnect the negative (black) cable from the battery. The ignition switch will have some sort of retaining nut that holds it in the panel. Remove that nut and slide the switch out of the hole in the panel. Disconnect the wiring from the switch (if the wiring connector is not shaped to fit only one way make sure to remember how the wires were connected, or write down which color wire goes where). As they say: assembly is the reverse of disassembly.
Answers & Comments
I'm not sure what a yts4000 is (a lawn tractor I assume). First disconnect the negative (black) cable from the battery. The ignition switch will have some sort of retaining nut that holds it in the panel. Remove that nut and slide the switch out of the hole in the panel. Disconnect the wiring from the switch (if the wiring connector is not shaped to fit only one way make sure to remember how the wires were connected, or write down which color wire goes where). As they say: assembly is the reverse of disassembly.