Hello hessa3,
Thanks for asking the Apple Support Communities for help with accessing your iCloud backup on your new iPad.
1. You should have an option on the screen showing "Didn't Get a Code?" with more options. Please check this article: Two-factor authentication for Apple ID - Apple Support
2. Depending on the way your account is set up, you may have the option to get a call to another trusted number, or get your code on another trusted device. Please check all your options here: Get a verification code and sign in with two-factor authentication - Apple Support
3. If you still have issues, you may have to set up your iPad as a new device to get it set up as a trusted device first, and then erase and set it up again. Restore your iPhone, iPad, or iPod touch from a backup - Apple Support
4. If you have no other trusted devices or trusted numbers, please use this article to regain access to your account: Recover your Apple ID when you can’t reset your password - Apple Support
Thanks and have a wonderful day.