It can be devastating when your computer faces a nasty crash. While Mac owners don't often like to admit it, this can happen on your iMac too. The process of rebuilding your iMac, reformatting the hard drive and reinstalling the operating system, can easily be accomplished via the Mac OS X Install DVD included with the iMac. Once the drive and OS are restored to working order, you can restore your personal settings and files using your TimeMachine backup.
Insert the Mac OS X Install DVD into the iMac. Restart the computer and hold down the "C" button to boot into the DVD.
Choose your language.
Select "Utilities > Disk Utility." Select "Macintosh HD," then click "Erase." Click "Erase..." and confirm the action. Quit Disk Utility after the erase finishes.
Click "Continue" on the main Mac OS X installer screen. Accept the license agreement.
Select the iMac's internal hard drive when asked to choose an installation destination. This should be the only option.
Click "Install." Click "Continue." The operating system is reinstalled on the iMac. Once finished, click "Restart" to reboot the machine.
Connect your external hard drive containing your TimeMachine backup to the computer, if you have one, and follow the on-screen instructions to restore your data to the rebuilt iMac.