Check the wire with a non contact voltage tester with the power and. Except in rare cases it is a hot wire or a switched hot wire.

3 Way Switch Installation
Wiring a light switch with a red wire. More about wiring a light fixture. The red and black are used for hot and the white neutral wire at the switch box allows for powering a timer remote control or other programmable switch. 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. Thats a good question. Wiring a dimmer switch 3 way dimmer switch wiring diagram fully explained 3 way dimmer switch wiring diagram will take the. The red wire is for the light switch.
Twist the two copper wires in the first box together and attach them to the ground nut on the switch. When you see a red wire in a 120 volt duplex outlet box its usually because one of the outlets is operated by a wall switch while the other is always on. Either disconnect the red wire from the switch or replace the switch with a single pole version. After reading where the red wire goes in a light fixture someone asked me where to connect the red wire to a light switch. Connect the red wire from the fan to the other terminal on the fan switch and the black wire to the light switch. The exact purpose of a red wire for a light fixture can vary.
If the electrical box was previously used for a fan the wall switch is probably a two pole switch. The first time i saw a red wire on a light switch it certainly confused me. Make a pigtail of the ground wire using two 6 inch lengths of bare wire and connect one ground wire to the fan switch and one to the light switch. In a three conductor cable the extra wire is red and its almost always used as a hot wire. When you see a red wire in a light switch box it can mean two things. This is an updated version of the first arrangement.
Consult the instructions that came with the light for the proper wire connections. Going out of both boxes and into your light fixture will be 143 wire which has a black wire hot a white wire neutral a red wire traveler and a bare copper wire ground. I have one in my kitchen and it scared me for years. Twist all the white wires in the box together and cap them. Because the electrical code as of the 2011 nec update requires a neutral wire in most new switch boxes a 3 wire cable runs between the light and switch.