To see how to 'Get a verification code and sign in with two-factor authentication', click here --> https://support.apple.com/HT204974
- 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 number (also landlines).
- 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, add a way. "You can manage your trusted phone numbers, trusted devices, and other account information from your Apple ID account page." --> https://appleid.apple.com/
From: https://support.apple.com/HT204915
If you have no available trusted devices or numbers, and cannot sign into your account (such as when you have a forgotten password) to add a way to get a verification code, read:
Recover your Apple ID when you can’t reset your password - https://support.apple.com/HT204921
"The fastest and easiest way to reset your password is from an Apple device. Before you start the account recovery waiting period, try to reset your forgotten password on a trusted device. Or borrow a friend or family member’s iPhone, iPad, or iPod touch and use the Find My iPhone app to reset your password. You can even visit an Apple Store and ask to use a device on site."
Contact Apple for help with Apple ID account security - https://support.apple.com/HT204169 "This article provides country-specific Apple Support contact information for customers seeking help with their Apple ID password or other security-related issues."