You can download music from YouTube using YouTube Music Premium by tapping the Download button in the app. For free options, use YouTube’s offline feature or legal third-party services.
For downloading music from YouTube it is not possible to download directly from youtube firstly you have to download another app like Snap Tube or you can use any website like mp3 converter to download.