Hi @Anonymous User
Please do check there is no debris in the speaker and mic ports.
If they are clear and the phone hasn't had an accidental bump or water damage then try the phone's internal diagnostic tools.
1. Launch your Samsung Members App and tap on the GetHelp button and them diagnostic and go through those.
2. Launch your Phone Dialer App and type in *#0*# and try those.
If your still having issues then let a Samsung Experience Store or Samsung Service Centre have hands on with your phone.
Some possible help links.
Microphone issues with Galaxy phone or tablet.
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. "