A switched electrical circuit has a switch mechanism installed in-line with the hot wire. This allows the switch to control whether the light is on or off while minimizing the danger of electric shock. Many electrical light fixtures that are intended to support only one light will have a switched hot wire, an always-connected neutral wire and an always-connected ground wire. Electrical boxes that can support two electrical devices will have an additional hot wire, which is normally red.
Each wire color identifies the function of the wire. The convention for wiring in North America identifies a neutral wire as having a white insulation jacket, a hot wire as having a black insulation jacket and a ground wire as either having a green insulation jacket or as being uninsulated. If there is more than one hot wire present, the second hot wire is colored red, blue, or black-and-white striped.
Some light fixtures are designed to power two electrical devices, such as a ceiling fan and a switched light fixture. For such a fixture, the ceiling fan would be powered by the black hot wire, whereas the light fixture would be powered using the red hot wire.
If there will be only one light fixture connected to the electrical box, and the box has two switched circuits, you may choose to power the light fixture by connecting to either the red wire or the black wire. You should always use caution when accessing an electrical box. If you're unfamiliar with it, consult a licensed electrician.