I go into the Recording Devices > Microphone > Properties > Listen to This Device > Enable. This successfully results in the microphone input coming out from the speakers. However, Audacity always results in the same message, no matter what:
“Error while opening sound device. Please check the recording device settings and the project sampling rate.”
I’ve set everything I can find to 48000 Hz. But I still get the error message.
Which recording device are you choosing in Audacity’s Device Toolbar or Preferences? You should choose either stereo mix (MME host may work best), or choose Windows WASAPI host then the (loopback) recording device for whatever device you selected as playback device.
I don’t agree with HTG that it is necessarily OK to have unmatched sample rates, especially if using MME host. So if you want to use MME and stereo mix, try Audacity project rate (bottom left) at 44100 Hz, then set Windows Default Format for a) stereo mix, b) the mic and c) whatever your playback device is to 44100 Hz in all three places.