Here are a few things to try:
- Check to see if the microphone is not being blocked by anything like dust, debris or a protective case
- Restart your device in case the microphone trouble is caused by apps or software.
- Check the phone's settings to make sure the microphone isn't muted.
- Remove any accessories attached to the device such as a clip-on mic, external microphone or wireless headset.
- Clean the microphone port and headset jack with compressed air.
- Reinstall the phone's operating system software and drivers.