First thing is to go to System Preferences/Security & Privacy and click on the Microphone item in the left sidebar. Then put a check on iMovie in the right hand pane.
Although pretty obvious, make sure that your microphone is turned on and that your cable connection is tight and Mac socket not defective or malfunctioning, and that your mic is not malfunctioning (try it with a different device).
Confirm that your mic is compatible with whatever operating system and iMovie versions that you are running.
If you are trying to do a voiceover, make sure that your external mic is selected in the voiceover settings.
In System Preferences/Sound your external mic should appear in the Input box, not the Output box. Make sure that the input volume slider is not set to mute.
Go to Applications/Utilitites/Audio MIDI Setup.app/Input and confirm that your external mic is listed in the left side bar. The mic needs to be plugged in.
-- Rich
xxx