Looking on eBay, there are suppliers that are selling the glass lens replacement for the iPhone 8. The whole bracket looks like it's soldered into the frame, but the lens appears to be replaceable. Internal Bracket View
The first thing to try is doing a hard reset. Hold the power button and home button until the screen goes black (it's powered off) and the apple logo comes back. Otherwise, you could have debris/corrosion in the charging port or headphone jack that is causing the phone to divert the sound to those outlets. Or, the speakers/volume buttons could actually have issues, but that is the most unlikely reason.