There are two ways to overcome this problem. One is to use a kind of electric current that periodically reverses direction, which is known as an alternating current (AC). In the kind of small, battery-powered motors we use around the home, a better solution is to add a component called a commutator to the ends of the coil. (Do not worry about the meaningless technical name: this slightly old-fashioned word "commutation" is a bit like the word "commute". It simply means to change back and forth in the same way that commute means to travel back and forth.) In its simplest form, the commutator is a metal ring divided into two separate halves and its job is to reverse the electric current in the coil each time the coil rotates through half a turn. One end of the coil is attached to each half of the commutator. The electric current from the battery connects to the motor electric terminals. These feed electric power into the commutator through a pair of loose connectors called brushes, made either from pieces of graphite (soft carbon similar to pencil "lead") or thin lengths of springy metal, which (as the name suggests) "brush" against the commutator. With the commutator in place, when electricity flows through the circuit, the coil will rotate continually in the same direction.
Suppose we bend our wire into a squarish, U-shaped loop so there are effectively two parallel wires running through the magnetic field. One of them takes the electric current away from us through the wire and the other one brings the current back again. Because the current flows in opposite directions in the wires, Fleming Left-Hand Rule tells us the two wires will move in opposite directions. In other words, when we switch on the electricity, one of the wires will move upward and the other will move downward.
The colors or numbers themselves are often a clue, but they alone may not provide sufficient information. There is always the trial and error method, but I do not recommend that because of the potential for destructive results. Instead, the Motor Doctors suggestion is to equip yourself with an ohmeter (don nott settle for just a continuity tester) and learn to perform a few simple tests with it.
The shield strongly attenuates the electric field noise. Core to shield capacitance is added to the stray capacitance, increasing ground currents in the loop. These currents generate a magnetic field. It is important to minimize the area of this loop as far as possible by routing the cable close to grounded metalwork.