Sound advice from Itchycopark, with the most important bit probably being the suggestion to clear your browser's cache. (It often helps solve website display problems). However, in order to provide you with specific advice on how to go about it, we'll need to know which web browser you're using. (Edge? Chrome? Firefox? Safari? etc). It might also help to know the type of device that you're using. (Desktop PC? Laptop? iPad? iPhone? Android tablet? Android phone? etc).
However if you can get into Google as a whole (rather than into YouTube specifically, which is part of Google) it might be simplest just to turn off 2-step verification, so that you no longer need to muck about with entering a code to use any Google service. Instructions here:
https://support.google.com/accounts/answer/1064203?hl=en&co=GENIE.Platform%3DDesktop
(That's what I've done, by the way. I hated those ruddy codes!)