All sounds? Or just alerts or music?
Is it the same with earbuds and without?
First take a look at this:
Understanding the side switch
Then try this:
Make sure IOS is updated to latest version
(How to update your iOS device
Reboot device by pressing both the home button and sleep/wake (power) buttons at the same time for 10-15 seconds until the apple logo appears on the screen, then let go.
If that doesn't work then reset the device by going to settings/general/reset/reset all settings (or for network connection issues 'reset network settings').
(no media or data will be deleted from the device, this will only take a minute).