Does the problem only happen with regular calls, or also with video calls and apps like WhatsApp? Because if it's across the board, it's probably software like the previous person said, but if it only fails in certain things it helps to know.
Anyway, beyond cleaning the microphone, try this: go to Settings > Privacy > Microphone and check which apps have permission. Sometimes after an iOS update something changes with permissions and the Phone app ends up without full access. If it shows no permission (or the toggle is off), turn it back on. Then go to Settings > Phone > Call Microphone (if that option exists on your version) and verify it's not disabled by accident.
If it still doesn't work, try force closing the Phone app completely (not just restarting your phone) and then open it again. Some users have had to do a network reset (Settings > General > Transfer or Reset > Reset > Reset Network Settings) to fix it, but that's more nuclear. Before going to tech support, it's worth trying that.