Whirlpool washer stopped mid cycle
If this happens "end of wash cycle, just as it should be starting to spin/drain" then it is very likely the lid switch. See # 14 in this parts diagram



If this is the problem then, depending on how exactly it failed, you can temporarily bypass it (either via wire or - according to some references from the linked page - possibly using magnets) to make sure that this is really the problem. But I can tell you from personal experience with older models that this is a very common problem, with an easy fix.