Or by buying vinyl at a local record store. Sadly, those are dying out, but you can find one or two good ones in any major city.
In electronic, hip-hop, and a lot of music that has a lot of computer-assisted production, a lot of producers will also release sample packs or VST presets that they sell directly on their websites. While often in small amounts, $50 or less, it more often than not goes directly to the artist with very little middlemen involved. While not a huge stream of revenue I'd imagine, it probably does help smaller artists if they can count on an additional couple hundred bucks a month from people that truly appreiciate their craft and I'd bet that if I reached out to artist XYZ whose music is no longer available on major platforms and said "hey i have been to a few of your shows, bought all your sample packs, and I can't find your tracks anymore" the artist, if small enough, would probably oblige and send along a nice little folder of music.