A microphone that Windows does not detect at all is a different problem from one that is detected but silent. The device is either disabled, hidden, unplugged, or missing its driver, and the fix is to find where Windows lost it and bring it back into the device list.
Fix it, in order
Check the physical connection. Push a wired microphone or headset plug in fully until it clicks, and try a different port. On a laptop, the front and rear jacks can behave differently, and a USB microphone should be tried in a port directly on the PC rather than a hub.
Show disabled devices. Open Settings, System, Sound, More sound settings, then the Recording tab. Right-click the empty space and tick Show Disabled Devices and Show Disconnected Devices. If the microphone appears greyed out, right-click it and select Enable.
Set it as the default device. In the same Recording tab, right-click the microphone and select Set as Default Device, and also Set as Default Communication Device. Some apps only use the default recording device, so a working mic that is not the default looks undetected.
Check microphone privacy. Open Settings, Privacy and security, Microphone, and make sure Microphone access is on. A blocked microphone can disappear from some apps entirely, which looks like it is not detected.
Reinstall the driver. In Device Manager, expand Audio inputs and outputs, right-click the microphone, select Uninstall device, and restart the PC. For a USB microphone, also expand Universal Serial Bus controllers and check for a device with a warning triangle.
Update the audio driver. In Device Manager, expand Sound, video and game controllers, right-click the audio device, and select Update driver. The microphone input runs through the same audio driver as the speakers, so a broken audio driver can hide the mic while sound still plays.
Try another port or another PC. If the microphone appears on another PC, the problem is this PC's port or driver. If it appears nowhere, the microphone or its cable has failed.
A headset with one plug carries both headphones and microphone on the same connector, and it needs a headset jack, not a headphone-only jack. On a desktop with separate mic and headphone jacks, a single-plug headset needs a splitter to use the microphone.
If it still happens
If the microphone never appears in Device Manager, even with hidden devices shown, check the BIOS or UEFI setup for an onboard audio or microphone setting, and test with a USB microphone, which bypasses the built-in audio chip. A built-in laptop microphone that never appears after a driver reinstall and a firmware check is usually a loose internal cable or a failed mic module.
Common questions
My headset mic is missing but the headphones work. Why? The headphone part and the microphone part are separate devices to Windows. Check the Recording tab with disabled devices shown, and make sure the plug is fully inserted, since a partial connection often carries sound but not the mic.
My USB mic is not listed anywhere. What now? Try a different USB port, then check Device Manager under Universal Serial Bus controllers for a warning triangle. A USB mic that fails on every port and every PC has a failed cable or a failed mic.
The mic shows in Device Manager but not in Sound settings. Why? It is probably disabled. Open the Recording tab in More sound settings, right-click the empty space, tick Show Disabled Devices, and enable it there.