Connecting end caps, or wire nuts as they are called in the industry, is one of the safest ways to terminate an electrical wire or tie two or more wires together. Wire nuts come in different sizes and have various colors which designate the gauge of wire and the number of wires that can be tied together. There is no standard color code, as each manufacturer has their own color designations. Generally, a yellow end cap is used for tieing two or three 12-gauge wires together, and a red cap for more than three. The packaging will give specific recommendations for use of the particular end caps.
Turn off any power (such as with a circuit breaker) or unplug any cords that might be supply electricity to the wires to be worked on.
Cut the wires to the desired length. Strip back the outer covering if necessary to expose the inner wires. Strip off one inch of insulation on the end of each wire.
Line up the ends of each of the wires until they are even, and twist them together in a clockwise direction.
Slide a wire nut/end cap onto the end of the twisted wires and twist the cap in a clockwise direction to tighten the nut on the end of the wire.
Wrap the end of the wire with the nut on with electrical tape to further insulate the connection. Leave about a half inch of the cap showing so you can see what color it is to reference the wires for later access.