The Apple Hardware Test comes in the Mac OS X Install Disc. To run the test, you must start your Mac from the volume or disc that contains the test.
Running the test when you’ve an Apple Hardware Test CD:
A. Insert the disc in Mac’s disc drive.
B. Restart the Mac.
C. Immediately press the C button on the keyboard and hold it down for a moment and the program will load.
D. When the Apple Hardware Test shows up on your screen, release the C button.
Running the test when you’ve a PowerPC-based Mac
A. Insert the Mac OS X Install Disc # 1, which came with the Mac into the optical drive.
B. Restart your Mac.
C. Immediately press the Option button on your keyboard and hold for some seconds. This will invoke Mac’s Startup Manager.
D. Once the Startup Manager opens, release the Option key. You will see the available startup volumes on the screen.
E. Click on the Apple Hardware Test icon then click on the right arrow and the program will load.
F. Select the Extended Test from the Hardware Tests tab to start the test.
It is recommended you run this test several times as all the issues may not come up in just one test.
If you have an Intel-based Mac, please see the instructions here. And if you have MacBook Air, visit this website for the instructions.