Check their is no debris or lint in the ports and ensure the headphones jack is firmly pushed in.
Perhaps try an alternative set of headphones.
A Samsung Experience Store or Samsung Service Centre can take a look @4sure
Daily Driver > Samsung Galaxy s²² Ultra 256Gb in Phantom Black.
The advice I offer is my own and does not represent Samsung’s position.
I'm here to help. " This is the way. "