If the socket or switch is bad, buy a new socket just like the old one. Skip to the final paragraph to learn how to rewire the socket. If the tested socket is functional, but the lamp still doesn't work, it's time to change the cord. First, disconnect the socket, if you haven't done so already, by detaching the wires from the terminal screws. Cut the old cord somewhere between the plug and the base of the lamp.
Cords comprise two insulated wires, joined at the middle.
Split the top two inches of the new cord down the middle, and use a wire stripper to strip half an inch of insulation from each wire. Repeat this process on the old cord. Repeat with the remaining two wires. A Western Union splice, when covered with electrical tape, should be able to slip through a lamp stem or chandelier arm. When the new cord is visible, disconnect the old cord, and discard it.