On an iPhone, iPad, or computer, you can turn off iCloud Music Library. The latter is only available if you have an Apple Music subscription. Turning it off will delete all the Apple Music songs that you had downloaded to your device (your iPhone, for example).
Steps
Method 1 of 2: Disable Music Library on iPhone

Step 1. Open your iPhone Settings

Tap the icon of Settings which represents a gray box with gears.

Step 2. Scroll down and choose Music
You will find this option towards the middle of the page of Settings.

Step 3. Tap the green iCloud Music Library slider

It's near the top of the screen. The cursor will turn gray

- If you don't see the option ICloud Music Library, this means that you are not an Apple Music subscriber and therefore cannot turn off (or turn on) iCloud Music Library.

Step 4. Press OK when prompted
This will confirm your decision and turn off iCloud Music Library. Apple Music will be removed from your iPhone. You can re-download the app at any time by re-enabling iCloud Music Library.
Method 2 of 2: Disable Music Library on Website

Step 1. Open iTunes
Click or double click on the icon itunes which represents a multicolored musical note on a white background.
If you are asked to install an update, do so before continuing

Step 2. Choose Edit
This option is located at the top of the window itunes. A drop-down menu will appear.
- On a Mac, click itunes in the upper left corner of the screen.

Step 3. Select Preferences…
This option is at the bottom of the drop-down menu. The window of Preferences open to.

Step 4. Click on the General tab
It is located at the top of the window of Preferences.

Step 5. Clear the iCloud Music Library check box
You should find it near the top of the window.
- If the box is not checked, it means iCloud Music Library is disabled on your computer.
- If you don't see this box, iCloud Music Library isn't available for your account.

Step 6. Choose OK
This button is at the bottom of the window Preferences. The changes will be saved and the Apple Music songs you downloaded will be removed from your library.