It is a common problem, but I don’t think there is a pre-baked answer, I suspect because the solution is a bit open ended.
Anyway, start here.
https://forum.audacityteam.org/t/avoid-hearing-previous-tracks-on-new-track-while-recording/42576/2
This is the open-ended part of the problem: Do you remember the settings you changed in order to record YouTube Audio (assuming you did)? Don’t do that.
Koz