With iTunes 7, it's possible to recover purchased music from your iPod. Unfortunately, this doesn't work with any other music you may have ripped or otherwise imported. It would probably be easiest to burn your library to a CD or DVD, and there are a few ways you can do this.
In iTunes' preferences, on the Advanced pane under the Burning tab, change the Disc Format to Data CD or DVD. Then, select a Playlist and burn it.
Insert a blank CD or DVD into the computer and drag items from your iTunes library and drop them on the CD on the desktop. When you've reached capacity, burn the CD.
You may also consider purchasing a burning utility, like
Disco, which provides the advantage of cataloging the contents of all the CDs that you burn, but require you to use the Finder to choose files to burn. Or, maybe Roxio's
Toast Titanium which can provide automatic backups. Unfortunately, Apple's .Mac
Backup provides the best differential/incremental backups.
Unfortunately, none of the above methods (except restoring from the iPod or using Backup, if you use it properly) will save your ratings or playlists, so you may also find it necessary to back up the iTunes Library files.
For all of the above methods, burning to a CD can be substituted with another hard drive or by using a disk image file.