In simple DC and universal motors, the rotor spins inside the stator. The rotor is a coil connected to the electric power supply and the stator is a permanent magnet or electromagnet. Large AC motors (used in things like factory machines) work in a slightly different way: they pass alternating current through opposing pairs of magnets to create a rotating magnetic field, which "induces" (creates) a magnetic field in the motor rotor, causing it to spin around. You can read more about this in our article on AC induction motors. If you take one of these induction motors and "unwrap" it, so the stator is effectively laid out into a long continuous track, the rotor can roll along it in a straight line. This ingenious design is known as a linear motor, and you will find it in such things as factory machines and floating "maglev" (magnetic levitation) railroads.
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 unshielded conductors radiate an electric noise field that couples capacitively with adjacent wiring. Stray capacitance at A & C cause ground currents to flow creating a magnetic noise field that couples inductively with adjacent wiring.
As a technician, I naturally look at things from a nuts & bolts perspective. As technicians, we understand objects and assemblies. We understand how things come apart and go back together. Is not this what Einstein and Ohm did? They figured out how "it" comes apart, which led to the ability of others to put "it" back together.