To see how to get a verification code and sign in with two-factor authentication' click here --> Get a verification code and sign in with two-factor authentication - Apple Support
- Use a Trusted Device: Mac, iPhone, iPad, Watch. Code is either generated automatically or manually using Settings on the Trusted Device.
- Text or phone call to a trusted telephone number (any telephone; even landlines).
- Get a code from an Account Recovery Contact --> Set up an account recovery contact - Apple Support
- Instructions at the end about what to do if you cannot get a code and need to use account recovery.
If you lack a way to view a verification code but can still log into your Apple Account, you can add a way to get a code. "You can manage your trusted phone numbers, trusted devices, and other account information from your Apple ID account page." Click here --> https://appleid.apple.com/
From: Two-factor authentication for Apple ID - Apple Support
If you have no available trusted devices or numbers, and cannot sign into your account, to add a way to get a verification code, read:
How to use account recovery when you can’t reset your Apple ID password - How to use account recovery when you can’t reset your Apple ID password - Apple Support
If you still need assistance:
Contact Apple for help with Apple ID account security - Contact Apple for help with Apple ID account security - Apple Support "This article provides country-specific Apple Support contact information for customers seeking help with their Apple ID password or other security-related issues."