How to Replace a Dryer Door Switch on a whirlpool
First, make sure the peg on the door that pushes the switch is in place and the two snap pegs that hold the door shut are not broken. If any of these are broken, replace them first and see if that solves your problem. If not, here's how to replace the door switch: Unplug the dryer. Pull out lint screen. Remove two screws revealed underneath. Slide a 1" putty knife between the top and cabinet at the top front corners on each side, jamb it in while tugging the top forward to release the clips, one at a time. Lift top and lean against wall. If it's a gas dryer, remove lower front panel and loosen two 5/16" hex head screws for top front panel. If electric, loosen same screws at bottom of front panel. Remove two 5/16" hex head screws holding front panel from inside near top. Carefully tilt front toward you, holding drum in place. Lift front panel slightly to disengage bottom screws and remove. Gently lower drum until it stops. Unplug two (sometimes three) wires to door switch on right side. Now the front panel is completely free. Remove two Phillips head screws holding door switch onto front panel. Reassembly is the reverse of disassembly. Make sure wiring to door switch is secured to cabinet so they don't drag on the drum, and are not pinched. Be careful realigning the drum into the door opening so felt seal is inside the front glide ring on the drum. After the front panel is in place, gently hand turn the drum to make sure it is turning properly and the belt in still hooked to the idler and motor pulleys. If the drum falls off the rear rollers, or the belt comes loose, you will have to correct it before putting the front panel back on, as you cannot reach them otherwise. Taking pictures during disassembly will help get it back together properly. It really is not as hard as it seems, you may even be able to replace the switch without removing the front panel. Also, if you have a three wire switch, write down where they go or snap a picture. If it's a two wire switch, it doesn't matter, it will work the same either way. Good luck.