Unplug the microwave before attempting any kind of repair. A microwave can be discharged only if it is no longer receiving power.
Remove the front panel from the microwave. This often requires a screwdriver but it depends on your specific microwave model. Check your manual if you have access to it. Once the panel is removed, you'll see the capacitor. It resembles a large battery.
Wear a rubber glove for added protection and hold a metal screwdriver with an insulated handle against one of the contacts at the top of the capacitor. Slide it forward so the blade of the screwdriver touches the second contact at the same time and hold it there. You're likely to hear a loud popping sound after a second or two.
Hold the blade of the screwdriver against one contact and bring the blade down to the base of the capacitor to connect the two. Repeat this with the other contact. The microwave should now be fully discharged.