Green is reserved for ground and. 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.

How Do I Connect A Light To A Switch When The Light Receives
Red wire in light switch. What is the red wire for when installing a light fixture. In my friends case the solution was simple if not intuitive. 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. It could be there is or once was a three way switch in play. 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 nec reserves certain wire colors for specific purposes.
The most common home wiring uses non metallic sheathed cable with three wires in it. Or it could be the red wire is the wire going to the fixture and the black wires are the live wires. Normally youll see a red wire in places you would expect a ceiling fan. Certain switch loop configurations require a three conductor wire the extra wire is needed to complete the circuit at the switch. 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. Red wire on the light fixture step 1 turn off the power to the light circuit then check the wires with a voltage tester to verify there is no voltage reading.
So the red wire is probably the one you want. Well cover the easier scenario first. When you see a red wire in a light switch box it can mean two things.