Replacing is NOT a good option for some models--Repairs are NOT that hard.
Hate to offer this advice, since I've heard of quite a few DIY that have been killed attempting this, since the power is, or can be still stored in the capacitor of the microwave, and KILL you dead, WHEN unplugged! Still, you can DIY or find a friend that can easily do this.
OTOH, I've got two very nice KitchenAid microwaves. I replaced the plain one that was installed over the oven, with a convection/microwave, (cost > $550). Eventually after 14 years, they BOTH "broke"--no heat, but everything else worked fine.
There is no possible good way to replace these microwaves inexpensively, since there is trim work that just isn't going to match properly or easily. So for me, the best option was to learn how to do it SAFELY and inexpensively. My cost for replacing both magnetrons was less than $80 total. It took about an hour each, plus a few hours learning and a few hours properly sourcing the part. Note that I am already an "almost" a real electrical and electronics tech/engineer. I will walk through what I did:
Troubleshooting:
If it won't heat water at all, but everything else is working fine, then proceed.
Safety:
Before you take it apart, KNOW that ANY of the exposed wiring can KILL you. Treat it all like a loaded gun. If charged, it has 5,000 high current volts available to do you in. After unplugged, FIND the exposed capacitor. You will need to ensure that the leads have been shorted together and also shorted to ground to the chassis. I've seen others use insulated screwdrivers to do this, which are likely fine. I built my own resistor network that both would discharge a 5,000 volt capacitor, but do it slowly, and would not arc over the resistors that were not natively rated for > 5000v. Do NOT "check" the live voltage, unless you have a high voltage probe made for tube TVs, rated over 20,000 volts. Now, make or get a permanent wire to short that capacitor while working on it.
Check the components:
Transformer
I checked the transformer with an ohm meter, on all the leads, and also checked it to ground. (I don't remember if ANY of the leads are supposed to be grounded, but if not, make sure it is infinite..) Also look for anything that might look burned or loose connections and repair if necessary. If the DOOR is broken, especially mechanically, do NOT try to replace!! If this leaks, it can slowly kill you--microwaves are really nasty, if let out of that box.
Diode
With an ohm meter, verify that it works--conducts in one direction only.
Capacitor
You should be able to use the ohm meter to first start charging the capacitor, and then reverse the leads, and charge it in reverse.
Magnetron
There are two wires that go to a heating element inside, designed to use 2-3v. That element is most certainly burned out, but you should be able to check it, (and check on the new replacement you just bought.) NOTE that neither of my broken magnetrons showed ANY problem, and yet still did NOT work! The element showed it was not broken or grounded.
Buying a replacement magnetron
You can buy the "official" KitchenAid for about $150-$200 if you are stupid, or buy the exact same part elsewhere. These are difficult and expensive to make, so there are really only a few models, and they are all private labeled and multiplied by 5x cost as a profit.
The magnetrons are not the same for Panasonic and likely others. GE, Amana and likely about 30 others are all going to use the "same" magnetron. The only differences will be how they mount, which is important. Notice which direction the main leads in the center come down from the magnetron, which will either follow, or oppose the exposed fins. This 90 degree mount determines MOST of the model, and possibly if the bolts come mounted on the frame or not. VERIFY YOUR part by looking up your model # microwave. But, the photos should match. You can buy these from Amazon, Ebay, or other specialty parts appliance sites for $35 - $45 DELIVERED. When you buy, you might also buy and replace the light bulb.
Unscrew the old, and screw on the new magnetron TIGHTLY, so the microwaves don't leak out. Connect all the leads up. Plug it in with a cup of water, and test it. (IF you have a chassis lockout switch, with obviously won't work until you reconnect it).
Reassembly
Now for the DANGEROUS part.... Remember that residual charge?? First unplug it, and ASSUME that all those wires are hot. You can either discharge that capacitor again, or find a way to stay away from then with the case. The circuit is SUPPOSED to self-discharge to safety, but YMMV so don't chance it. Once that it is reassembled, retest it before re-mounting it.
That's it.... Leave me a comment if you'd like me to post some links for sourcing the magnetron later.
BONUS
After replacing, do NOT toss those magnetrons. They are not named that way for nothing. Pry the case apart so you can remove the fins and the tube. You will find two HUGE POWERFUL magnets. Remove the fins, and then carefully remove the magnets. If you've saved the box it was shipped it, or a larger one with foam, STORE your magnets carefully, so stray energy doesn't destroy other things. Be more careful that you think you need to be, since they can break fingers and pinch painfully. I have the four I removed, and can use them to pick up nails from roofing or re-find anything ferrous in the yard.