Audio CDs
The best and easiest way to create a digital music library is to RIP them from an audio CD. Windows Media Player had this built-in functionality but is now an extra-cost application (app) in Windows 10. Other non-Microsoft audio players have similar capability. Since you paid for the CD, you own the music, no matter what format it takes. See Digital rights management.
Vinyl Records
If you have vinyl records, the simplest way to to rip them is to use a modern turntable with a USB output. Cheap turntables sound OK for playback but better turntables are better at digitizing records so do your research. You can also use an turntable with RCA jack outputs but computers generally do not have these RCA jack inputs unless you've installed a special sound card. You could use an adapter cable with a pair of female RCA jacks on one end and a 3.5 mm (aka 1/8") male audio plug on the other. The signal output strength of a turntable is low so, if it doesn't have its own pre-amplier, you'll have to add one. Alternatively, you can use a an analog to digital converter (adc) with a USB output.
The turntable should ideally have its own vinyl ripping software but there are downloadable software available. Since metadata (song title, artist, album, etc) aren't included in vinyl recordings, the metadata tags for each song in your library would have to be manually edited and the vinyl ripping software will allow you to add these tags. While it is possible to individually add tracks from a vinyl album, it is easier to rip an entire album side and then separate each track afterwards with audio editing software.
Cassette Tapes
If you have old audio cassette tapes, the digitization process would be similar to vinyl records but the audio quality of the old tapes was never really good even when they were new and time does not favor magnetic recordings. For the effort required to digitize an audio cassette tape, you should first try to find a better recording.