Unplug the washer or dryer, so it is not receiving power during the test.
Access the motor for your washer or dryer. The method for this varies depending on the model, so check your manual. There is typically an access panel in the back that must be opened to reach the wire leads for the motor.
Disconnect the wiring harness connected to the motor leads. It should just pull off. Set a multimeter to a setting of "R X 1."
Touch each probe of the multimeter to the leads on the motor, and read the gauge output. The multimeter reads the resistance of the motor, and it should be reading close to zero.
Ground one probe by touching it to the metal casing of the washer or dryer. Touch the other probe to each lead individually. There should be no reading at all as a result of this. If the motor fails either or both of these tests, it needs repair or replacement.