You don't give us much to go on, but I'll take a guess.
Check the lid switch. It's the safety switch that shuts down the machine
during the spin cycle (and agitate in some cases) when you open the lid.
Easy to check with a continuity tester.
HomeOwnersHub.com is a website for homeowners and building and maintenance pros. It is not affiliated with any of the manufacturers or service providers discussed here.
All logos and trade names are the property of their respective owners.