Hello sudhanshu116,
Thank you for reaching out in Apple Support Communities. If we're understanding correctly, you're unable to use your new Apple device due to two-factor authentication. We'll be happy to help.
With two-factor authentication, were you able to receive the verification code? The verification code is needed in order to verify your Apple ID account on your new device. If needed, here are the available methods in receiving the verification code for two-factor authentication of your Apple ID:
Use the code displayed on your trusted device
If you have a trusted device running iOS 9 and later, OS X El Capitan and later, iPadOS 13 and later, or watchOS 6 and later, the verification code is displayed automatically on your trusted devices.
- Sign in with your Apple ID and password on a new device or browser.
- Look for a sign in notification on any of your trusted devices.

3.Tap Allow to receive your verification code.
4.Enter the verification code on your other device to complete sign in.
Get a text or phone call
If you don’t have a trusted device handy, you can have a verification code sent to your trusted phone number as a text message or phone call.
- Click Didn't get a verification code on the sign in screen.
- Choose to have the code sent to your trusted phone number.
- You'll get a text message or phone call from Apple with your verification code. This text message might include an additional domain validation line. This line includes the @ symbol, the website name, and your code (for example: @icloud.com #123456 %apple.com).

5.Enter the code on your other device to complete sign in.
Get a code from Settings on your trusted device
If you can’t receive a verification code on your trusted devices automatically, you can get one from Settings, even if your device is offline.
From your iPhone, iPad, or iPod touch
If your device is online:
- Go to Settings > [your name].
- Tap Password & Security > Get Verification Code.

If your device is offline:
- Go to Settings > [your name].
- Tap Password & Security.
- A message says "Account Details Unavailable." Tap Get Verification Code.
From your Mac
- Go to Apple menu > System Preferences, then click Apple ID.
- Click Password & Security > Get Verification Code.

This information is outlined in this helpful article: Get a verification code and sign in with two-factor authentication - Apple Support
Validating your Apple ID account with two-factor authentication will help you to successfully set up your new device.
If we misunderstood the issue you're experiencing, please provide us additional details to help gain a better understanding. That way we can provide you the best support.
Best regards.