Make sure the volume isn’t all the way down by pressing the volume up button.
If you’re in the Music app and notice that the volume slider is far to the left, move it to the right. If that doesn’t work, try clicking the Volume option in the menu bar at the top of the screen. If you are using Big Sur or Monterey, this option is in the Control Panel section of the menu bar. Drag the sound slider to the right.
Check another app: Sound may be playing in iTunes or Music, but not in Safari, as sound may be turned off in Safari.