Thank you for the question. The first thing you want to do is check your music library in iTunes to see if your media is present. If this media is there, then you can sync it back to the device. I have attached an article that shows you how to syncing this media to your iPhone. If the media is not present, you can download any past purchases to the computer by following the second article below.
Hope this helps,