If you are also having problems with your sound or volume of your iPhone, please check the following steps to see if they help.
1) On your iPhone, go to Settings, then choose Sounds. Then drag the RINGER AND ALERTS slider to turn the volume up.
2) Turn to the left side of your iPhone. If you see color orange here, your device is set to silent. Reset it to ring.
3) Restart your device. If you are with iPhone 7 or iPhone 7 Plus, press and hold the power button, which is on the right side of your device. Then press and hold the Volume Down button on the left side to shut down. Then hold both buttons until the screen turns on.
4) Open your music app, then change the volume in Control Panel.
5) Connect a headset. If you can heat sound coming from the headset, remove it and then use a soft, clean and dry brush to clean off the dust or debris in the port.
6) Then go to Settings again. Choose Bluetooth and then turn it off. See if you get the sound back.
7) Update your device to the latest version iOS. Follow the path: Settings > General > Software Update.
8) If you have done all of the steps above, and still cannot get your sound or volume back, it is suggested that you make an appointment with Apple Support for them to see if there is anything needed to be done to your iPhone.