When installing a light switch, it is important to be aware, first and foremost, of correct safety precautions. This will make the installation proceed much more easily and possibly more quickly as well. There is not much advanced skill involved in installing a light switch, and it can save a lot of money compared to hiring an electrician.
Before performing any electrical work, it is important to disconnect power to the circuit that the switch will be on. This is done by removing the fuse or tripping the breaker for the corresponding circuit. There are tools available to test whether an outlet or a switch has power going to it or not. In the absence of these tools, or simply to be extra safe, it may be a good idea to disconnect power at the main breaker where wiring enters the house. Keep in mind, however, that this will turn off all electricity to the house, which may or may not be desirable.
Once you have made sure that the circuit is not connected, the wiring in the wall must be attached to the switch. There should be two wires visible -- a white one, and another one that's black or red. The white wire is neutral and runs continuously from the power source all the way to the light or other fixture. The black or red wire is sometimes called the "hot" wire, and this is the one that will be connected to the switch itself. On the side of the switch will be two brass screws, called terminal screws. The hot wire will connect to both of these screws once it is cut.
The best way to connect the black wire to the terminal screws is to strip the insulation off of the wire, and make a curve or loop in it, which can be most easily gripped by the terminal screw. The loop should be placed under the head of the screw going the same way as the screw threads. In other words, if the screw tightens clockwise, which most do, the loop should be going clockwise, so that tightening the screw will tighten the wire underneath it, instead of loosening it. Depending on the type of light switch being installed, there may be other terminal screws as well. A green terminal screw is for connecting a grounding wire, which will also be green, and a light-colored or silver terminal screw is for connecting the white wire.
Once all the connections have been made to the light switch, it can be pushed back into the switch box and screwed into place. At this point, it is safe to restore power to the circuit, and test the light switch to see if it works properly. If there is a popping noise, smoke, or other trouble, this means that the wiring was incorrectly connected at the switch and must be repaired.