The black wire is used in all electric circuits and is always the "hot" or live wire. It usually runs from the switch to the electrical load.
Treat all wires with caution, because any wire can carry small currents of electricity at times. Knowing the colors of wires is part of safely working with electricity. Red is a secondary live wire; green is a ground wire; yellow or blue also carries power; white and gray are neutral wires. This code is used in all electric systems in the United States. Anything built before the 1940s could use a different color code since the coding of all electronics wasn't yet codified.