Make sure you never slam the lid shut while doing a load. It may sound silly, but if you’re in the habit of slamming the lid down, you’re also in the habit of wrecking your lid switch.
If your washer fills with water, but refuses to agitate or spin, you have confirmation that the lid switch is officially broken.
It is best to gently close the lid each time you do a wash. This will go a long way to preventing a very avoidable breakdown.