I did a bit of reading online about troubleshooting steps. Of course the obvious one is turning the phone completely off and then back on.
Another thing I saw mentioned was plugging in the earbuds or headphones into the jack. Do you get any sound coming through headphones or earbuds? Have you had that plugged in recently? If there's something stuck in there, the phone could think there is still a headphone plugged in and then you would get no sound.
Has it been connected to anything by bluetooth recently? When using a hands free system in a vehicle, the phone itself won't make any sounds while connected by bluetooth to the hands free system in our truck unless I'm playing the music that's on the phone. If the bluetooth is on, try turning it off and see what happens.
Check the headphone port and the charger port for debris, maybe even blow in there lightly or use canned compressed air (like what is sold for computers...this would deliver a gentle enough air flow to not do any damage). If there is anything in those ports, the phone might think it is docked or plugged into an earphone jack.
There is also a hearing aid setting in the phone that you could try toggling on and off and see what happens. We had to make some change to that setting with my husband's phone because the volume on his was down so low that he couldn't even conduct a phone conversation. You access that through the Accessibility settings.