If you suspect that the hardware in your Apple Macintosh computer has become faulty. By using a tool built into macOS called Apple Diagnostics, you can check the internal components in your computer to see what might be causing a problem or find system failures. 
A diagnostic test will take about 2 to 5 minutes. It’ll check your computer’s RAM, power controller, logic board, battery, and wireless modules. If there’s an error, you’ll get a reference code. You can look it up yourself or ask an Apple-certified engineer for help.
Note: Just a heads up, the method shown in this video for accessing Apple Diagnostics is for any Apple Macintosh computers with Apple Silicon hardware. If you have an Apple Macintosh computer with Intel hardware, the process is a bit different.
- To place your Apple Macintosh computer into Diagnostic mode, first power down your computer.
 
- Now with our computer shut down if we press and hold down the power button for roughly 20 seconds or until our display shows us the Start-up Options screen.
 
- From within the Start-up Options screen, we need to press and hold down the Command and D keys on our keyboard.
 
- We can release our fingers from the Command and D keys, when our computer reboots and we are shown the Diagnostic mode.
 
- After choosing a language, we can choose to either run a diagnostic test offline, or by selecting I agree run a diagnostic test that will send data to Apple. 
 
Notes: Running a diagnostic test will take roughly 3 to 5 minutes to complete. If you are testing a laptop you should connect your computer to the mains while you run your test.