If you are using iTunes, you need to be aware that if your hard drive crashes or other catastrophic error occurs, you could lose everything in your iTunes library. While free content can be downloaded again (if it is still available) with only a loss of time and effort, any purchased content from iTunes will be lost. iTunes and Apple are not responsible for your purchased content, and there is no way to replace this content other than re-purchasing it.
As a safeguard against this disaster, you can back up your iTunes library. The process is similar, whether you are using a Mac or a PC. Your iTunes library is simply a folder that contains more folders which in turn contain the files you have downloaded and/or purchased. In a typical installation, there is a folder called iTunes which contains another folder called iTunes Music and a file called iTunes Library. The iTunes Library file is simply a database that stores information about where your music files are located and how you have organized your playlists. Backing up this file will NOT back up your music files! You need to back up the whole iTunes folder to retain all the information currently in iTunes.
Unless you have changed the default location of your iTunes folder, on a PC it should be located within My Documents > My Music. To back up this folder, simply copy the folder called iTunes and either save it to another computer, an external hard drive, or burn it to a DVD if it is small enough to fit. Any time you make new purchases, you should back up these new files as well.
On a Mac, double-click the hard drive icon and go to Music (under Places on the left side of the window). The iTunes folder should default to this location. Back up the iTunes folder to a secure location.
It is also possible to transfer music from your iPod or mp3 device back to iTunes, depending on what device you are using. If you are using an iPod, you will need to purchase third-party software to do this. If you are using an mp3 player, you will need to consult the manual to see if it is possible to move your files back onto your computer. Using your portable device as the sole means of back up, however, is NOT recommended!
Thanks to Tracy Newman for this tip.