Unplug the touch lamp. Unscrew the finial holding the shade in place with your hand, remove the shade, unscrew the bulb from the lamp socket when cool enough, and remove the harp, which supports the finial that holds the shade to the lamp.
Turn the lamp over to access the bottom. Remove the screws securing the bottom plate with a Phillips screwdriver.
Locate the sensor in the base of the lamp. The sensor is often square and either white or black, it is connected to four wires -- a black, white, red or gray, and yellow one. All wires, except the yellow wire is connected to the lamp wire. Pay attention to how the wires are connected, you need to install the new sensor the same way.
Remove the nut holding the yellow wire in place with pliers. Then twist the connectors holding the three other wires to free them, and remove the touch sensor.
Insert the new sensor in place. Twist the white, black, red or gray wire connectors in place, and secure the ring on the end of the yellow wire to the base of the lamp with the nut.
Screw the bottom of the lamp back on. Replace the harp and bulb, and plug the lamp back in. Test the touch sensor to make sure it is working correctly, before replacing the shade and finial. If not working, unplug the lamp again and make sure the wires are connected properly. If it does work, you're in business. Replace the shade and screw on the finial.