I have a local library of ALAC albums that I like. I used Syncthing to sync it to my home server, where there is a Plex installation (When I want to play via the ATV). And I convert to AAC 256kbps to my iPhone (Bluetooth is lossy anyway). More hassle than playing via Spotify, but the latter's UX is so bad that it's worth it. Also I have some excellent headphones (Hifiman Sundara and Sennheiser 6XX).
I believe modern iTunes is DRM free so you can keep all your purchases safe that way. Alternatively Youtube Music allows you to upload all your local music so you can their service to stream it. I've bought things on iTunes and then uploaded them to Youtube Music.
Relying on anything that is closed source, or worse, an online service, brings with it the eventual inevitability of losing everything. No product or company lasts forever.
For things that are ephemeral in interest (e.g. movies you only care to watch once), that's fine.
For things that you really like and want to have a strong guarantee you can enjoy them later, the only solution is open formats and have the data in your control.
For all the music (and a few handful movies) that I want to be able to enjoy forever, I keep them locally in a redundant backed up ZFS server. No corporate change of heart can ever take those away from me.
A decade ago I moved off the good iTunes and foolishly lost my complete library of metadata of songs, so I want to avoid that again.