The fan motor is connected by two or three wires. Label the wire placement on the motor before disconnecting the wires. The wires are connected to the terminals with slip-on connectors or a plug. Firmly pull the connectors off of the terminals (do not pull on the wire). You may need to use a pair of needle-nose pliers to remove the connectors. Inspect the connectors and the terminals for corrosion. If the connectors are corroded they should be replaced.
Test the fan motor for continuity using a multitester. Set the multitester to the ohms setting X10. Place a probe on each terminal. In the photo below there are three terminals, the middle one is for ground and does not need to be tested. The multitester should display a reading approximately mid-way between infinity and zero ohms. If the motor does not pass this test, it should be replaced.