Whirlpool washer will not finish wash cycle

I took closer look at lid switch after receiving your advice and found it was not fully closed when lid was down. There is a audible click when switch is closed. It did not click unless I pushed down on lid directly over lid switch. I ran a cycle and washer stopped at same point it usually does. This time I did not bang on lid but just pushed down on the lid directly over switch. The cycle started back up and finished. Does this mean the switch is bad or just needs adjusted? Is there something I can do to fix without replacing switch? If no, how much is switch and how difficult is it to replace?