First of all, I'd like to say well done for thinking about doing this before anything bad happens
Time Machine is a good idea (you'll need an external drive for that, unless you want to use your internal drive, but using an external drive is easier), but I think a 'cloud' solution is good as well (A 'cloud' solution is basically where your files are backed up to a secure location via the Internet). Carbonite is one such service. Be aware that you have to pay for this though
If you don't want to do that, though, iLounge has a very comprehensive guide to backing up your library of content.