I don't know what you did specifically to lose your music (based on the info you provided), but what you did not do (which you should) is back up your user data, including your iTunes data. If you had a user data backup, even if your complete computer failed (or its drive failed), you can restore your user data from the backup. If your computer is a Mac, use the built-in Time Machine feature to automatically back up your data (every hour), as a background process, to an external drive.
If you don't want to back up "everything," this Apple document explains how to back up just your iTunes data to an external drive
Manage and back up your iTunes media library - Apple Support
To summarize, the first step it is to gather ("consolidate") all of your iTunes data into your iTunes folder, which is in your user account Music folder. Then, you copy that iTunes folder to an external drive to create your iTunes data backup. Repeat this periodically; if you get a new computer, do it one last time from the old computer. When you need to restore from the backup, copy your backed up iTunes folder to your computer's drive.
I would get a pop up box asking me if I wanted to upgrade to the newest version of iTunes. I'm afraid to do that as well for fear of losing everything again.
Updating the iTunes application does not erase your iTunes data. It just updates the app. However, it's always a good practice to regularly back up your user data, including your iTunes data.
NOTE: If you start using a new (different) iTunes library with your iPod, when you set up automatic syncing with the new iTunes library, the iPod's existing content (from the old iTunes library) is erased and replaced with content from the new iTunes library. If THAT is your current situation, please post back with more details.