More information would help. Is this a tractor you just got...like that?
There are different ways to go about it...but how I'd do it.
I'd get paper, pencil, multimeter, masking tape.
Tape about 2" over wires near connector ends. Number them 1,2,3,...
Meter on ohms, Rx1. Short leads...be sure reads 0 ohms. Now switch has 5 connectors. Measure 1 to 2, etc. Write down key in on position...1 has continuity to 3 (for example)...cranking 1 to 4.
Meter on DC volts. Ground black lead. Measure all wires. Say wire 1 measures 12.6 volts. Now touch wire 1 to 3...headlights come on. 1 to 4...engine cranks. (Write all this down!).
Now we know you want wire 1 to switch 1. Wire 4 to switch 4.