How to listen to music while recording

Previously, I was able to listen to the YouTube song, stereo, etc. while recording to Audacity. I did this by plugging a cable into the microphone jack on the front of the computer. I hadn’t done any work for some time but now find that I must connect the microphone to the headphone jack to record to Audacity, but I can’t hear it. Not as convenient. Could someone give me a hand here? Thanks.

This is a bit confusing, Can you detail a bit more about the path you expect the signal to follow?

The simple version of the question is how can I listen to what I am listening to on YouTube while I’m recording it on Audacity? I haven’t tied other sources yet.

Use the “WASAPI loopback” method as described in the manual here:

If you were here, I’d buy you a steak dinner!! Not only did this give me what I wanted it also solved a problem I had with 3.1.3. After upgrading to 3.1.3, my playbacks sounded “tinny” and were missing a lot, like something was absorbing the bass side or some such. It was almost like a baritone was singing alto in an empty room. I know I can’t describe it well at all. THANK YOU EVER SO!!!