Back in the day, people used Napster to build their music collections. I didn't because I had dial-up. Most of the students at UW-Eau Claire were busy doing that while they weren't busy making time on futons. Because I didn't have fast internet or a futon, I would have tried alternate methods (not patrolled by cyber cops) to build my (mythical) music library, which I don't really have. If you want to consider what it would take to build a similar mythical library, read on.
Old School Before Old School Was Cool
An input into your computer can be recorded as a music file. Audacity is a free program, but even Windows Movie Maker can do it. Just record the input. If the input is a record player with an adapter into the audio in plug, then you can record your old records. If you run your TV through your stereo for sound, then plug the headphone line into your computer, that's another way to record what you have access to. Since we're talking audio and not video, no special adapters or boards are needed for the computer itself. Just get the source into the audio in and you can record it in real time. That's the problem, of course: you have to sit there and listen and then hit stop and save the file. Since most of us are too lazy or busy for that, we'll buy an mp3-recording phonograph for $100 instead (and probably still never get around to recording the old LPs).
Newer School But Still Kind of Old School
Go to the library and get the CDs you want. Rip them as mp3 files. Done. It takes about five minutes and you get all the songs. You can pick and choose if you want. You might have to change some settings, but the newer media programs will find the album art and name the tracks, as opposed to a decade ago when you had to do all that yourself. However, you need a CD player and a bit of time at home, and people don't tend to have either anymore. The good part about this method is that it's not entirely illegal, as you are just making a copy of your own or a borrowed CD so that you can continue to listen to it on another device. In fact, if you own the CD, you own the rights to play that song, and if your CD gets old and dies, you have the right to get the rights to that song again. Good luck doing that, so just make copies of your CD collection and then sell them to 50 year-old men who want to play them in the CD players in their Mustangs,
Total New School
Youtube hosts a lot of songs. Sometimes these are official music videos and sometimes they are user-uploaded. You can use the old-school method above to record Youtube as it plays through your computer, or you can download one of a dozen programs that convert the video (with audio) into an mp3 format. Youtube downloading programs are borderline legal. Then again, Youtube itself, with all the allowed copyrighted content, is also borderline. If Youtube is allowed to host it and you're allowed to view it, then it's more legal for you than Napster, which was some college guy sharing it with a million of his friends without permission.
If you decide to download mp3s in some way, I'd recommend getting some lists of great music so that you're not just wading through the most popular stuff that may not be good for your ears. I used this website to identify music I might like to listen to. If you're wired all the time, maybe you don't need to download these tunes, since they're pretty available on Youtube or online radio. However, if you don't believe free will remain free or don't want to pay $1 a song with the mp3 sites, then you might want to consider your options.