Breaking it down into basics:
battery to Controller. 2 wires, red and black. 10Guage is best. 12 is acceptable. 14 guage is common. Fuse goes on the Positive (red) wire**
Controller to motor, Main Power. 3 wires. Blue, Yellow, Green. 12-14 guage is common.
Controller to motor, hall sensors. 5 wires. red, black, blue, yellow, green. 24-26 guage.
Controller to throttle. 3 wires. Sometimes 4. Colors vary. usualy black, red, yellow. Blue for 4th wire when present. 24-26 guage. (4th wire is for battery light on the controller, but isn't needed for functioning)
Controller to brakes. 2 sets of 2 wires, Red and black. 24-26 guage. Un-needed to function
Controller to CA. *Optional* 6 wires. Colors vary. 24-26 guage if present.
Controller Speed restrictor. 2 wires, white, 24-26 guage. OEM option. These wires when hooked together limit the power to the motor. leave them unhooked.
There can be 2 additinal plugs, 5 pin on the controller. 1 is for the PAS, the other for Cruis controll. they may not be present.
Essentualy, you only need the throttle, battery, Motor, and hall sensor wires to be connected. Nothing else needs to be connected
** Some controllers have 2 red wires going to the battery connector. the thinner wire is for a switch. Best Practice is to leave off the switch and have both wires connect to the battery unless you are using higher than normal voltage. The battery should always be completely disconnected when not in use.