You should be able to enter it where your passcode goes. And, in fact, try your passcode if what you receivee elsewhere doesn't work.
Also see, See Get a verification code and sign in with two-factor authentication https://support.apple.com/en-us/HT204974 Below is an excerpt, but read the whole document. See the bold italicsbelow.
“Whenever you sign in with your Apple ID on a new device or browser, you'll confirm your identity with your password plus a six-digit verification code. There are a few ways you can get a verification code. You can use the code displayed on your trusted device, get a text or phone call, or generate a code from your trusted device [see the additional information in the article].” A trusted device is an iPhone, iPad, or iPod Touch with iOS 9 and later or a Mac with OS X El Capitan and later that you've already signed into using two-factor authentication.