You don't provide many details other than the washer will not drain and spin but if your Whirlpool washer will fill and agitate but won't drain and spin then the lid switch is the most likely cause of this problem.
The instructions to access the lid switch are in the image below. Remember to unplug the washer first. The 1st image shows how the console is raised and the cabinet removed to access the lid switch. Your particular washer doesn't have two screws in the front corners to raise the console. The 2nd image shows where and how to raise the console on your particular washer.
The lid switch can be check with a volt/ohm meter or without a meter is caution is used. The 1st image also shows you how the lid switch can be bypassed to check this problem.
The lid switch is part number 3949247 and is available from the following link:
I hope this information helps to resolve this problem but submit another question with any additional details for further assistance.