All you need is an external hard drive. As a rule of thumb, you want at least the same capacity as your internal hard drive. Ex. If you have a 500GB internal, use a 500 external.
Open system preferences
Turn time machine on. It will ask you where to back up - be sure to select the correct disk
That's it! As long as you have it plugged in it will back up every hour. If anything happens to your files or your computer, you will have a copy.