There are many types of electric motors, today I will explain how to test the most popular golf cart motors:

Series Wound Motor:
There are 4 connections on the motor, we'll use the following as an example. A1, A2, F1 and F2. The letters could differ. Put a jumper wire from A1 to F1 so they are connected. Now jump the A2 and F2 connections with a 12 volt battery or battery charger. It does not matter which polarity. If the motor is good it will turn over.

Shunt Wound Motor:
Again there are 4 connections on the motor, we'll use the following as an example. A1, A2, F1 and F2. The letters could differ. Put a jumper wire from A1 to F1 so they are connected, and another separate jumper wire from A2 to F2. Now run a current from a 12 volt battery from the A1/F1 connection to the A2/F2 connection. It does not matter which polarity. If the motor is good it will turn over.