It's just a
notification, it can be ignored (for me). I don't usually even notice its there until hours later. You don't have to acknowledge it in any way.
It also has nothing to do with the YouTube app, and there is no code I have to enter anywhere.
I've never had any form of 2FA on my Google account.