Pull-cord switches have a tendency to wear out over time. It is suggested that the pull-cord switch in your light fixture be changed once a year if your fixture is used regularly. Pull-cord switches are found in lamps, ceiling fans and porcelain light sockets. Once you learn how to wire a pull-cord switch, you will be able to replace any pull-cord light switch in any fixture as they all wire the same.
Turn the power off to the light fixture by turning off the breaker at the main electrical panel.
Remove the shade and the light bulbs from the fixture to gain access to the screws holding the fixture onto the ceiling junction box. Remove the screws with a screwdriver and release the light fixture. Remove the wire connector that holds the white wire from the junction box and the white wire from the light fixture together. Remove the wire connector holding the black wire from the junction box onto the black wire from the pull-cord switch. Leave all other black wires tied together.
Remove the pull-cord switch. Remove the retaining nut located on the outside the light fixture. The retaining nut holds the switch into the light fixture. Remove the wire connector from the black wire on the switch that connects it to the black wire from the light fixture. Discard the old switch.
Install the new pull-cord switch. Twist a wire connector onto to one black wire from the switch and onto the black wire from the light fixture, connecting them together. Thread the collar of the pull-cord switch through the opening in the light fixture and attach the retaining nut to hold the switch in place.
Reinstall the light fixture. Attach the black wire from the ceiling junction box onto the black wire from the switch by twisting an orange wire connector onto both wires. Connect the white wire from the ceiling junction box onto the white wire from the light fixture, connecting both wires together. Reattach the light fixture onto the ceiling with the screwdriver and screws you removed from the fixture. Replace the light bulbs and the light shade.
Turn the electrical power back on to the light fixture.
Always test to confirm the electricity has been disconnected to avoid electrical shock.