This post was in response to a now banned user who was posting questions copied from other users
See here for help with WASAPI errors: http://wiki.audacityteam.org/wiki/Release_Notes_2.1.2#wasapi.
Make sure in Windows Sound that "Listen to this device" is not enabled for Stereo Mix. If you have multiple analogue playback devices such as headphones or speakers, ensure in the Realtek Control Panel that the connector is set to the device you are using - if you are using headphones but the connector is set to speakers this could cause issues when recording stereo mix.
Obviously if you are using a USB headset or headphones, that is a separate device from Realtek and you cannot record that using Stereo Mix - you must use WASAPI loopback.
If YouTube is your only concern then you can download the videos instead then add FFmpeg to your computer. Drag the videos into Audacity to extract the audio. Ensure you have copyright holders' permission before recording or downloading from YouTube.