This will cost you. You need to purchase an external hard drive to use with Time Machine. When your internal hard drive fails, you will then need another external hard drive to restore to from Time Machine. You will be using that new external hard drive to work from until you're ready to repair your Mac.
The Time Machine basics:
The size needed for this hard drive depends on how much space you expect to use on your internal hard drive. If you're currently using only about 30GB of your 500GB hard drive and you don't expect to be adding a lot of videos or photos in the future, then you can safely use a 120GB hard drive. In other words, your Time Machine backup drive should be about three times the size of what is being used in your internal drive. You need the extra size because the Time Machine keeps a running history of all the changes you make.
If you want to be able to go back in time by several months to recover a lost file or an older version of a file, you need the extra size. If all you want to do is keep a few days or a few weeks of older versions then an external drive a little larger than what you currently use would be sufficient and save you money. For example, to back up 30GB, use a 80GB hard drive. Good luck finding one that small.
When the Time Machine is disk gets full it just removes the oldest backup to make room for the new backup. Hence, the smaller the external hard drive, the less history you can save. It should be noted that if the Time Machine disk is small, it will need to frequently delete an older backup to make room for a new one, and that takes more time.
The interface for the Time Machine disk can be USB 2.0 or Firewire 400 or Firewire 800. If you don't mind that it takes a long time to perform a backup (many minutes instead of a few minutes) then use USB. Time Machine works in the background. Still, when it does run, it requires computer resources. If you don't like being slowed down a little while Time Machine is running (about every hour), then find a hard drive with a Firewire 400 or Firewire 800 interface (800 is faster than 400) - and be prepared to pay a lot more. Alternatively, turn off Time Machine when you are using the Mac and turn it back on when you're away from your Mac (the Mac has to be on and not asleep for Time Machine to work; the display can sleep, but not the computer).
Here are Apple's instructions for setting up Time Machine. The type of interface to choose for the new external hard drive you intend to use as a temporary startup disk is up to you.
Recovering from a failed internal hard drive:
This is rather simple.
- Make sure your Time Machine disk is connected and turned on.
- Connect a new external hard drive to the computer and turn it on (same size or larger as the internal drive).
- Insert your Mac OS X Install media in the CD/DVD drive.
- Hold down the C key when you press the power button. The computer will boot up from the install media in the CD drive.
- When the Language Chooser appears, select your language, and then click the Continue button.
- In the Installer, choose Utilities » Restore System From Backup.
- Select the Time Machine disk and click Continue.
- Select the latest backup from the Time Machine disk.
- Follow the onscreen instructions to select the new external hard drive to restore to.
- Be patient while the restore takes place.
If you used a clone instead of the Install media to boot up from, you only need to restore everything from the latest backup of the Time Machine to the clone. Do that after you boot up from the clone the first time.
Booting up from the new external hard drive:
- Hold down the Option key while you press the power button and keep it held down until the Start Up Manager appears.
- When the Start Up Manager appears, select the new external hard drive to boot from.
- When the computer is up and running, open the System Preferences.
- Select the Startup Disk icon in the fourth row of icons.
- From the available disks showing, select the new external hard drive as your new system startup media.
- Restart the Mac.
- Each time now that you start up the Mac, it will boot from the external drive without having to do anything special.
Play safe so your Mac won't disappoint you. You can print out this note for future use.
[crarko adds: OK, this is not groundbreaking news to those of us who have been supporting Macs for a while, but once again for the benefit of the newer users it's nice to have step-by-step guides. I've had to do this kind of recovery for Windows desktops and servers and I once again marvel at how fortunate we are to be using Macs.]

