Hi @cenk226 ,
Is the phone in a protective case?
If so try removing it from the case and check if you can be heard OK when on a call. The case may be blocking the phone’s voice inlet hole that conveys the sound to the microphone.
If not or it is still no good if removed from the case, try using a vacuum cleaner to clear the voice inlet hole on the bottom edge of the phone, in case it is blocked with lint or dust etc. Do not use a pin or probe to try and clear it as you may damage something in the phone.
If still no good after trying to clear the hole, the phone will have to be opened and the microphone and microphone’s connection inspected and tested etc.
Here’s the ifixit Motorola Moto X4 Motherboard Replacement guide that will help you to gain access to the microphone. (supplier example only to give a close up view of the underside of the part)
Here are some images showing the location of the microphone’s voice inlet hole and also the microphone on the systemboard that may help.
(click on image to enlarge)