Make a call to any number, switch to hands-free mode i.e. sound will come from the external loud speaker instead of from the internal earphone. Do not switch back, just hang up the call. Now the sound will back to normal.
BTW on how to check whether your phone are currently in the buggy state: go to system settings, sound, check ringtone or notification sound and click to preview the tone. The sound may come from the earphone instead of the speaker. This usually happens after a call that end with earphone in use. This seems does not affect a phone with bluetooth earphone.