If you connect the Samsung Galaxy S8 with the headphones, then a small headphone icon appears in the status bar. This will tell you that the device now outputs the sound through the headphones. If you remove these now, then the symbol should actually disappear.
If this still remains visible in the status bar, then please proceed as follows to solve the problem:
Plug in and unplug the headphones
It usually helps to plug in and unplug the headphones several times. This will clean the contact in the socket and cause the software to access the smartphone's speakers again.
Clean the headphone jack
Does not help, then the headphone jack of the Samsung Galaxy S8 must be cleaned. This is done in two steps:
1. Carefully dust dust and dirt from the headphone jack with a toothpick
2. Put the Samsung Galaxy S8 in a bowl of clean water for about 5 minutes (your Samsung Galaxy S8 is waterproof)
Then wait until the smartphone has dried again. To accelerate this, completely dry and then blow with a hair dryer on a low level and with cold air bubbles. Turns off the S8 completely and then turns the device on again. There should no longer be a headphone icon. If it does, then it may be that there is a defect. Here, the device must then be given in the repair.