What exactly does it do? It lets power flow through allowing the motor to start. Have you every started a load of laundry and walked away, when you come back the washer is full of water and it hasn’t started washing? When you shut the lid it automatically starts washing, this is because the inside of the switch made contact when the lid shut allowing voltage to pass by.
The washers control panel will need to be lifted to gain access to the switch. On a direct drive washer, the control panel or console has two screws in the front two in the back or the front edge will have two metal clips fastening the control down. If you see no screws that need to be removed the trim on the edges (Kenmore style) will need to pop off, on the trims back side is a slot to be used to pry the trim off.
With the control flipped up, the clips that hold the cabinet to the frame can be released. With the lid switch disconnected and gold clips removed the washers cabinet will left up and off.
On the right is the gold clip that will release the cabinet from the washer, a screwdriver pushed on the backside is enough to pop the clip up and out of the groove. Remember to disconnect the lid switch before removing the cabinet, the washers lid switch is mounted to the cabinet from the bottom side with several screws.