If your device has a Ring/Silent switch, move the switch forward—toward the device's display—so that orange isn't showing. If you're using an iPad, you can also swipe down from the top-right corner to view the control center and make sure that Silent Mode is off. Restart your iPhone: press the Power/Sleep switch and the Home button at the same time. Keep holding both buttons until the screen turns off and then turns back again and displays the Apple logo.
Go to Settings > Sounds (or Settings > Sounds & Haptics), and drag the Ringer and Alerts slider back and forth a few times. If you don't hear any sound, or if your speaker button on the Ringer and Alerts slider is dimmed, your speaker might need service. Contact Apple Support for iPhone, iPad, or iPod touch.
If you hear the sound, try making a call with your iPhone and turn on the speakerphone. On iPad or iPod touch, make a FaceTime call. If you still can't hear or hear static or crackling, then your network or reception could be the issue. Try to call again later, or from a different location.