If earphones don't work in the jack, or the phone thinks earphones are always plugged in, check the jack.
1. Try another set of earphones.
2. Look into the jack with a torch and remove lint with a wooden toothpick.
3. If the phone shows a headphone icon with nothing plugged in, the jack's switch is stuck or there is moisture inside.
4. Plug earphones in and out a few times to clear dirt.
5. On many phones the jack is on the charging board, so replacing that board fixes it.
If the jack stopped after water, have the charging board checked for corrosion.