Switch loops if you see a red wire spliced together with a black one in a 120 volt outlet its probably because the outlet is powered by a wall switch. When you see a red wire in a light switch box it can mean two things.

Where To Connect The Red Wire To A Light Switch The Silicon
Red wire in light switch box. It could be there is or once was a three way switch in play. The red wire is most likely a spare wire that was intended to be used when wiring for a ceiling fan. Certain switch loop configurations require a three conductor wire the extra wire is needed to complete the circuit at the switch. It should be identical to the measurement when you touch the ends of the black and white wires with the voltage tester. The wall switch typically when a ceiling fan is installed the red wire is most commonly used for the light and the black is commonly for the fan motor. The red wire as a spare wire when a ceiling fan is not installed this spare red wire is insulated with electrical tape or capped off with a wire nut.
Test the wires in the ceiling box with a voltage tester. Some sheathed cable includes a fourth red wire which makes it useful for wiring fixtures with three way switches or a ceiling fan with separate light and fan switches. So the red wire is probably the one you want. If you change a light fixture and find a red wire in the electrical box chances are the black wire from the fixture needs to go to the red wire in the box. In my friends case the solution was simple if not intuitive. Normally youll see a red wire in places you would expect a ceiling fan.
Sheathed cable with a red. If there is an extra red wire you should get a reading of 120 volts when you touch the terminals of the tester to the red and white wires. Or it could be the red wire is the wire going to the fixture and the black wires are the live wires. Well cover the easier scenario first. But in places like a bathroom or a wall light if you see a red wire its a good bet that the red wire is the wire thats connected to the light switch.