Freegal
Your local public library should include Freegal in its online resources. With your library card, you should be able to log into Freegal and download up to 5 high quality (ie, 256 kbit/s) songs per week, with no digital rights restrictions. I use this service a lot and add music that I want to download to my wish list, which can be as large as 250 songs. Unfortunately, many artists and/or aren't in the Freegal library. Every Monday, Freegal emails me a reminder that I have 5 downloads available. I find that it's easier to add a batch of songs to my wish list and then just download them when I have a chance during the week. Freegal includes a 30 second sample clip so you can try before you download.
I save high bit rate songs in my Downloads folder (eg, \downloads\freegal downloads\) and convert them to a lower bit rate for my MP3 player in my Music Library. I use fre:ac - free audio converter for the bit rate and file name conversion. FRE:AC may be configured to create any folder structure and file name you need for your library. I use <artist>\<album>\<title> but you can use <artist>\<album>\<track> <title> if you want to include the track number in the title. There is a track number metadata tag so including the track number in the title is probably redundant.
To avoid confusion with new, unconverted Freegal downloads with converted downloads, I move songs to a different Freegal folder (eg, \downloads\freegal\) after they've been converted. That allows me to have lower bit-rate songs in my music folder while still keeping its high bit-rate version safe in case I need it again.
If you're happy to just stream music and don't need your own copy, another free option from your public library is Hoopla Digital.
YouTube
Many songs can be found on YouTube and there are several programs that can convert a YouTube video to an audio recording. I use MediaHuman YouTube to MP3 Converter, which supports a variety online video sources. These songs generally require editing of its library data.
Sometimes, entire albums are contained in one YouTube video. In this case, you would again convert the video to MP3 but, like a vinyl conversion, you would then have to separate each track with audio editing software. This would allow you to play individual songs or shuffle the album during playback. If you don't mind listening to an album in its entirely, you can skip track separation.
Music Stores
Amazon Music,Google Play Music, iTunes, and Windows Store/Groove Music are examples of online music stores. As part of your account registration, you include your credit card number and any music you download is automatically billed to your credit card. Music downloaded from these sites typically has DRM so you can only play it on devices registered to your account.
Others
Songs may be available in other online locations. Some web sites host music and allow you to freely download it. Artists sometimes offer their music for sale through their own web sites. I do not recommend going to file-sharing sites because of the risk of infecting your computer with viruses to get pirated music.