Recording lagging behind

Hello, I feel like I’ve made a post about this before. Whenever I try recording something right before I start playing audio, the line will stay at the beginning. It is like it is not recording any sound at all. But as soon as I play audio t is fine; however, When I stop recording the audio pushes back and I have to move it forward so I don’t lose audio. Then when I try recording that technically already bugged audio, the 2nd clip skips something, or repeats it. Is there any way to fix this at all?

Which version of Audacity? (look in Help > About Audacity)
What are you trying to record? What are you trying to do?

I am using 2.0.6. I was trying to record a song from YouTube so I could remix it. But when I tried to record it had problems.

Audacity 2.0.6 is very old. The current version of Audacity is 2,1,3, which you can get here: Audacity ® | Download for Windows

That’s because there is nothing to record.
When using WASAPI, the audio stream only exists ‘on demand’. If an application (such as your web browser) is accessing the sound card to play a video, then an audio stream exists and Audacity has something to record. If there is no audio stream, then Audacity cannot write the audio stream to disk until an audio stream starts.

Sounds like you are referring to “latency correction” Latency Test - Audacity Manual

What sample rate are you using? Try both 44100 and 48000 Hz. The setting in Audacity (“Edit >Preferences > Quality”) and the setting in the Windows Sound Control Panel need to match.