It is a common issue for many microwave users. The main reason behind this issue is magnetron failure.
Magnetron uses high voltage to produce frequency in the microwave so that it can cook the food.
If you turn on the microwave in an empty condition, the magnetron may burn out. And it can’t be repaired. So, you need to replace it to fix the non-heating issue.
Otherwise, this problem may occur due to capacitor burn, faulty diodes, transformer failure, etc.