Maytag washer problem

Had some problems with not draining in prior to spin cycle but could always get past it by restarting that cycle. Now it is dead and will not restart. It just stopped at spin in delicate cycle. What part needs to be changed? It started up on its own after 20 minutes. My wife says it just does not drain all the time during spin cycle.

Since it seems to operate mechanically when it does operate, see if changing out the timer will fix things.