The colors regulated by the national electrical code in the united states are standardized for safety. Neutral common or return.
Wiring Diagram Electrical Conductor Electrical Wires Amp Cable
Black and white electrical wire. The different colors of electrical wires indicate the function of the wire with black and red indicating the wires carry electric current white usually indicating neutral charge and green indicating the wire is grounded. White wires with black or red tape. Like black wires they can also be used in some types of switch legs. Also black wires are often used as switch legs in circuits which is the connection linking a switch to the electrical load. Typically this is indicated with a band of black or red electrical tape but other colors may be used wrapped around the wires insulation. Hot when a white wire is augmented with a red or black color marking this often indicates that it is being used as a hot wire rather than a neutral wire.
However those same 220 volt appliances can be wired with a black and white wire where the white wire had been marked with black or red tape at both the appliance and in the main panel to indicate. The black wire is hot. Although neutral these wires still may carry a current especially an unbalanced load so handle with caution. The white wire goes by many names that all mean the same thing. In 220 volt circuits red wires are the secondary live wires. Black wires are always hot wires meaning that they carry electricity.
You connect the black wires in the electrical box to the switch terminals and the white wires to each other. The switch also has a green terminal for the ground wires which usually are bare. If you see a white wire marked with black or red or a piece of black or red electrical tape at its ends that means its acting as a hot wire and is no longer neutral. The ground wire is usually left bare but in some cases the ground wire color is green. The neutral wire can also be gray. The white wire is always neutral and when the cable has only two conductors as most 120 volt cables do the hot wire is black.
Power flows from the box to the outlet through the black wire and back to the box through the white one. According to standards in use since the mid 1900s a wire color code identifies the purpose of each wire in an electrical circuit. Consider all black wires to be live at all times. The black wire will be your hot wire and your whites are neutral depending on your switch setup you can wire nut the blacks together with an extra piece of wire coming from the wire nut to connect the hot to the light as well as the same method with your white wires.