I dl with yt-dlp, I get mp4/webm/mkv.
Then I extract audio with ffmpeg. ffprobe can tell what is the encoding of the audio within, recently I found opus which is quite fine and just extract that. But previously I consciously created .ogg or mp3.
Sometimes I have to use other tools such as SoundConverter to convert to format I want, or Audacity if the album is in full in one video to cut out separate tracks from it (then usually export to .ogg or mp3).
I'm using Linux.
If you want I can give you pointers.