Power off your microwave and unplug the power cable.
Open the microwave door and insert the tip of your flathead screwdriver in the seam where the interior door panel meets the body of the door. Work your way along the door, popping the internal clips of the panel as you go. Remove the panel.
Locate the door sensor mechanism. It will likely be located on the side of the interior of the door. There will be terminals protruding from the sensor. On some model microwaves there will be one terminal, on others there will be three.
Check the wiring that is plugged into the terminals on the sensor. Ensure that the wiring is plugged in securely. If not, unplug the wiring and plug it back in. You may have to lick a locking tab up to loosen the wiring. If the wiring or the sensor is damaged beyond repair, proceed to the next step.
Unplug the wiring and remove the screw holding the sensor mechanism in place. Remove the sensor mechanism.
Fit a new sensor mechanism in the door compartment and replace the screw and wiring. You can purchase a new sensor from the manufacturer or from an appliance supply store.
Replace the interior door panel.