I have an Android phone and use BubbleUPnP to stream YouTube / YouTube Music to my Raspberry Pi 4 B running moOde. The Pi is connected to my DAC via USB.
To set everything up, you first need to have a streamer that can act as a UPnP renderer. This will be the destination for the stream that you cast from your phone. Then you need to open up BubbleUPnP and select the streamer from your list of renderers (it should auto-populate). Finally, when using YouTube or YouTube Music, tap on the three dots next to the video or music selection you want to hear and select ’Share’, then pick BubbleUPnP from the list that appears. This will start the stream from your phone to the renderer.
Here’s a nice explanation from Cambridge Audio if all this is a little confusing - https://www.cambridgeaudio.com/row/en/blog/what-upnp
Positives are that this method gets rid of any ads. Downsides are that if you try to stream a playlist, BubbleUPnP seems to buffer each song in the list before playback starts so it can be a while (perhaps a half minute or more) before you hear music.
I can also use AirPlay to cast from an iOS device to my streamer, but it doesn’t strip out any ads.