Engadget
How to find your MacBook's diagnostic menu

Apple Diagnostics runs hardware tests when invoked (Power + ⌘ + D on Apple-silicon Macs, D on Intel Macs) after updates and with external devices disconnected. macOS 12 and later allow selection of components such as display, keyboard, or trackpad; earlier versions start automatic testing. It returns component-specific error codes or ADP000 for no faults, and does not assess external accessories, software, or macOS issues.