Diagnosis
The microwave is getting power, but the cooking function is dead. The most likely culprit is the door interlock switch system failing, which tells the microwave the door is safely closed.
How to Fix It
This is a common safety feature failure. First, unplug the microwave. You'll need to remove the outer cover panels to access the switches mounted near the door latch. There are usually three small microswitches. Test each one with a multimeter for continuity when the door latch is engaged. The faulty one won't click or show continuity. Replace that specific switch. Reassemble and test.
If That Didn't Work
The secondary cause could be a blown main thermal fuse on the magnetron. This is a one-time safety device that blows if the unit overheats. You'll need to locate and test it with a multimeter. If it has no continuity, you must replace it.
Heads Up
Working inside a microwave involves high-voltage capacitors that can hold a lethal charge even when unplugged. If you're not comfortable discharging them safely with a properly insulated screwdriver, call a technician. This isn't a regular fuse swap.