Instructions apply to iOS 10.0 and up, and macOS 10.10 and up.
To enable this feature, turn on Library Syncing for your Apple ID/Apple Account.
Go toSettings>Music, then turn onSync Library.

Touch and hold the song, album, playlist, or video, and then tapAdd to Library.
Go to yourLibraryand tap the song, album, playlist or video you just added.
Tap theDownloadicon (cloud with a down arrow.)

Open YouTube Music and navigate to the song, album, or playlist you want to download.
iCloud’stermsexplicitly prohibit the uploading of content for which you don’t have the express permission to copy or share.
On your Mac, open Finder and navigate to iCloud Drive.

SelectFile>New Folder(or pressShift+Command+N).
This creates a new untitled folder.
Name the folder “Music.”

Locate the tracks you want to access on your iPhone.
Drag them across to yourMusicfolder.
Your music will automatically upload to iCloud Drive.

Once your tracks have uploaded, your music will be available via iCloud on your iPhone.
To access them, open theFilesapp on your iPhone.
Navigate to and tap theMusicfolder to open it.
You’ll see the same tracks you uploaded via your Mac.
Tap the track you want to play and it will automatically download to your gadget.
Alternatively, tap thecloud and arrowicon to save the track to your iPhone.
Tap any track to play it within iCloud Drive.
Your iCloud Drive files on your iPhone are mirrored to your iCloud Drive Files on your Mac.
If you delete tracks on your iPhone, they’re automatically deleted on your Mac, and vice versa.
Your music is now saved to your iPhone.