Hi! Since you have tried another set of earphones, check the driver, check the sound output via speaker, It confirms already that the 3.5mm jack is faulty or dirty (cannot get proper connection due to dirt build-up inside the port or just really faulty already.
You can try test and move around the cord plug into it while the wired earphones is connected to it try moving the plug left to right see if there are sound output changes. (If there are sound changes then it only proves its dirty only) you can take it to a local tech to have checked.