Welcome to Android Central! Does it work on speakerphone, or with wired or Bluetooth headsets? If yes, then there's a problem with the primary phone mic. Make sure the mic opening isn't blocked by any debris or lint. If it looks clear, then the mic itself may be faulty.
Also (and obviously), make sure you're not on Mute.