Light bulb sockets can be screw-in types, bayonet types or pushpin types, but they all function by channelling an electrical current into the light bulb. Basic sockets either have two conducting wires, or two conducting wires and a ground wire. In both cases, the wires travel from the electrical source to the socket terminals to create a functional circuit.
Split the end of a standard household or lamp cord (12 or 14 AWG) by slitting it down the centre to a length of 2 to 3 inches. Use a sharp utility knife for this procedure, and measure the correct length with a tape measure or a ruler.
Use a wire stripper to remove approximately half an inch of insulation from each wire at the split end of the cord.
Open the light bulb socket cover to access the wiring terminals. Some sockets unscrew, and others pry open with a screwdriver. Remove the socket cover and place it to one side.
Pull the socket insert out of the socket. The socket insert will have electrical terminals mounted on its side.
Push the split end of the wire through the bottom of the socket cap, and tie the ends into an "underwriters knot." This is the knot recommended by Underwriters Laboratories for knotting electrical wire. Make a loop in each of the wires, push each stripped end through the opposite loop, and pull the loops tight (see Resources).
Twist the bare wire strands together clockwise, so that no strands are loose.
Attach the wires to the socket terminals. Unscrew the terminal post screws and wrap the wires clockwise around the posts. Connect the non-ribbed or "hot" wire to the brass terminal, and the ribbed or "neutral" wire to the silver terminal. If you have a three-wire attachment, connect the green or "ground" wire to the green terminal post. Tighten each screw firmly.
Reassemble the socket. Seat the socket insert first, and then push or screw on the socket cover.
Always unplug all cords before working on electrical devices. If this is a permanent mounted fixture, turn off the main circuit breaker before accessing the wires.