Cut the power to the circuit on which you're working at the main circuit breaker box. Notify everyone in the house of your project so that they don't switch the circuit back on while you're working on it. Unscrew and remove the face plate covering the existing switch, and set it aside. Remove the screws holding the existing switch in the junction box.
Unscrew the terminal screws that attach the wires to the existing switch. They will not remove completely; just loosen them enough to remove the wires. You may need to work the wire with the pliers to remove it. Set the removed switch aside.
Prepare the wires for the new switch. Strip off the last inch of insulation on the end of each wire if needed. Bend the exposed metal of each wire into a hook shape.
Hook the green or bare copper wire to the green ground terminal on the pilot light switch. Hook the black wire to the black terminal, if there is one. Hook the remaining wires to the remaining terminals. If there is no black terminal, just hook one wire up to each of the terminals. Since it's an alternating current circuit, it doesn't matter which terminal the wires connect to. Tighten the terminal screws until just snug. Wrap the back of the switch in electrical tape to protect the connections.
Screw the switch into the junction box. Replace the face-plate and screw it into place. Switch the electricity back on from the circuit breaker. Your new pilot light switch is ready for use.