To repair a table lamp switch, replace the bulb, tighten or reattach any loosely attached or broken terminal wires inside the socket respectively if the new bulb fails to light, and then replace the socket if the bulb still fails. This procedure, however, varies with the lamp type and make.
Disconnect the lamp from the power supply, then unscrew and remove any light bulb. Locate the electrode that attaches to the bulb, usually found at bottom of the bulb. If necessary, push in the electrode to detach it from the bulb and gently pry up the electrode with a screwdriver. Replace the bulb with a new one, reconnect the lamp and test the switch.
If the new bulb fails to work, disconnect the lamp and unscrew the light bulb again. Using a small screwdriver, press the latch located on the socket cover to pull up the cover and access the wires inside the socket. Tighten any loose terminal screws to firmly secure the wires on the posts. If necessary, use a wire cutter and stripper to cut and strip any broken wires respectively, before securing them to the terminals with screws.
Replace the cover and bulb, then plug in the lamp. Replace the socket if the bulb fails to light.