Wiring kits that include the lamp socket, lamp cord and plug are available from most hardware stores, or you can buy each part separately (may be necessary if you need a long cord). For most lamps, you will want to buy a #18 size cord.
If wiring the plug and the lamp socket yourself, notice that the attachment points (usually two screws) are different colors. The white or shiny screw is the neutral and should go to the widest prong on the plug. The other screw is usually a darker color.
Mount the lamp socket base to your lamp. Usually it will mount to your lamp by way of a small threaded pipe. You must secure this small pipe to your lamp in some way; usually by drilling a hole and gluing or screwing the pipe into the lamp. They also sell long threaded pipes for lamps that can be run completely through the lamp and attached on both ends with a tightening bolt.
"Fish" the wire through the lamp. Sometimes a coat hanger that has been cut and straightened will help in "fishing" the wire through. It is important that all components of the lamp be mounted (except the top of the lamp socket shell) before you run the wire. If you are not going to fish the wire through the lamp, they do sell sockets that allow the lamp cord to come through the bottom part of the socket shell.
Attach the plug to the wire, making sure the "ridged" wire goes to the wider prong on the plug. Some plugs are made so you just stick the wire into a hole and close a lever. Some plugs require you to physically attach the wires to screws.
To attach wires to screw terminals, you must first take off a little insulation to expose the actual conducting wire. This is called "stripping" the wire. The hardware sells inexpensive wire strippers or you can do it with a knife. Just be sure you do not cut any of the wires inside the insulation.
Notice that the wire in lamp cord consists of many fine wires for the two main conductors. After you strip the insulation off of the wires, twist these fine wires tight for each conductor. You should end up with two tightly wrapped conductors. The two conductors should be separated enough to allow them to be connected to the screw terminals.
Notice that the two screw terminals tighten by turning them clockwise. The twisted tight conductors are wrapped around the screw for at least 180 degrees and the wrap goes in the direction of clockwise so that when the screws are tightened, it pulls the wire toward the screw, not away from it.
Reassemble both the plug and the socket as necessary, making sure there is no excess wire sticking out that can short to the other conductor. If any of the wires from one conductor touch the other conductor, you will have a "short." You do not want that. It can shock you or cause a fire.
Attach a shade to your lamp. Shades attach several ways; but the most common is via a mounting bracket that goes below the lamp socket and a heavy wire harness (harp) that attaches to the mounting bracket and has a mount for a lampshade.
It is also important to ensure that decorative items or wires are not too close to the lightbulb. Always leave spacing from the lightbulb and other materials which can cause burning and damaging.