First off, the Software/Computer forum would have been the better place to post this, as that's where video game stuff tends to go. Hopefully a mod will come and move it.
Secondly, it depends on the game.
PC games you can usually find programs to open up the packfiles and grab the music from there, if it's not already available. You'll have to do some searching on your own for that, but I would check fansites.
Console games, the earlier consoles you can rip them from an emulator. You can get one from
Zophar's Domain but you'll need the ROM, and that's illegal and won't help you find that - you're on your own there. There might be sites that offer the music, but I don't know where off hand. The CD-based consoles (PS, PS2, XBox, GC) you're pretty well out of luck, as far as I know on the matter. In theory there should be audio files on the discs, but I don't know how to extract them at all.
There's a livejournal community dedicated to video game music
here. You might try asking there as well.