First see if it works on speakerphone. If not, take the phone to your carrier for assistance.
If that works, find the mic hole for the normal phone mic and look into it carefully with a strong light. If you keep the phone in your pocket, that hole, usually being on the bottom of the phone, fills up with lint, and lint is a great sound absorber. Clean it out with a small wooden toothpick.