Welcome to the Apple Support Communities. It sounds like you're an Apple Music subscriber and lost the music you had downloaded for offline play by signing out of your Apple ID. I'd be happy to see if there's any solution for you. First of all, I just want to mention that you're experiencing an expected behavior. Since the songs downloaded for offline play are cached on the device rather than the Apple Music account, signing out of your account is essentially processed the same as letting a membership lapse.
That said, there are a few things you can check. If you used Apple Music with another device and the offline play tracks were accessible there, you might be able to re-sync the offline play tracks by ensuring that iCloud Music Library is enabled. Check this out: Turn on iCloud Music Library - Apple Support
If that doesn't work, you might be able to recover them by restoring from a back up. Use this link for help locating back ups, and this one for guidance through the restore process if you do find one: Restore your iPhone, iPad, or iPod touch from a backup - Apple Support. Just be aware that any data accrued between the back up date and today would be lost if you restore.
I hope this helps explain the situation. If there's anything you'd like explained more clearly, just let me know and I'll break it down for you.
Page content loaded
Question: Lost my music