Examine the light bulb and determine the wattage used in the lamp. Divide the light bulb wattage by 110 (your line voltage) to determine the current carrying rating required for the switch. For example, if you have a 100-watt light bulb---100 divided by 110 is 0.91 amps---so procure a switch rated at one amp or higher. Feed through switches are available at most home centers or hardware stores.
Unplug the lamp.
Determine the location on the lamp wire where you would like to locate the switch.
Cut between the two wires in the lamp cord using a utility knife to separate them. Do not expose the copper conductor, just cut the insulation down the middle. Make the cut 1/2-inch shorter than the length of the switch.
Identify the hot wire on the lamp cord. It is the one that is unmarked, typically with no ribbing, striping or other indicators on it.
Cut the unmarked wire in the middle of the area where you separated the individual conductors.
Disassemble the switch. Note if this switch has screw terminals or small metal pincers. If screw terminals are present, skip to step 9.
Place the lamp wire into the switch. The cut wire will fit into a channel that contains two metal pincers, and the uncut wire will feed through the switch without any connectors.
Loosen the two screws. Strip 3/8 inch of insulation from both ends of the wire that you cut in step 6. Twist the wire strands into a single braid and wrap it clockwise around each screw and tighten it. There should be no insulation under the screw and no bare copper extending from the screw. It does not matter which wire goes to which screw.
Reassemble the switch.