The first thing to do, is to track down what if anything may have happened to cause the music to disappear from the iPhone.
Did you recently restore the iPhone or erase it?
Did you recently upgrade the iOS version?
Did you sync the iPhone with a computer that did not have the music library in its iTunes or Music app?
Were you using an Apple Music or iTunes Match subscription you recently cancelled?
Did you turn off Sync Library in Settings ➜ Apps ➜ Music?
- An iPhone should never be the only place your music is stored, you should always have a backup on a computer or even an external drive.
- If you no longer have a backup for this music that can be accessed from a computer, there may be no way to get the music back.
- If the music still exists on a computer you have access to, you can resign it to the iPhone from there.
- If you were using Apple Music or iTunes Match, and still have an active subscription, then make sure you have the Sync Library option turned on as explained above.
- If you cancelled the subscription and the Music was coming from the iCloud library, it may now be gone and be irretrievable.