They often run wires from the switch to a remote outlet but there s no reason why the switch and outlet can t be in the same electrical box.
Light switch and outlet in same box.
Buy a single pole switch if one switch controls the lights or a three way if you have two switches controlling the same lights.
When that s done you can treat the cable coming from the outlet into the switch box as a regular line cable.
The diagram below shows the power entering the circuit at the grounded outlet box location then sending power up to the switch and a switched leg back down to the outlet.
It depends how you want the switch and receptacle to function.
If you want the receptacle to be powered all the time and want to use the switch to control a load other than the receptacle such as a light fixture you wire it like this.
This diagram illustrates wiring a gfci receptacle and light switch in the same outlet box a common arrangement in a bathroom with limited space.
To wire a gfci circuit breaker see this link and wire a gfci switch combo at this link.
This diagram illustrates wiring a gfci receptacle and light switch in the same outlet box a common arrangement in a bathroom with limited space.
If you discover a three slot outlet in an ungrounded box the easiest fix is to simply replace it with a two slot outlet as shown.
Notice that these outlets have the tab removed from the hot side or brass side of the outlet which allows the top half of the plug to be controlled only from the switch.
Wiring a gfci outlet and a light switch in one box.
Wiring a light switch and outlet on the same circuit is something that electricians do regularly.
Wiring a gfci outlet and a light switch.
When the wiring connections are made properly there is always the possibility for the wiring in a switch box to provide power for a light switch while providing power to outlets on the same circuit.
Wiring for a switch and gfci receptacle in the same box is also shown.
Twist the white wires together and cap them and connect the ground wires to the ground terminal.
Standard and halogen bulbs require standard incandescent dimmers.
One will be the power line coming from the breaker box and the other will be the wires connected from the light switch to the light fixture.
Connect the black wire to one of the switch terminals and the black wire going to the light fixture to the other switch terminal.
The hot source is spliced with a pigtail to the line terminal on the receptacle and to on terminal on the light switch.