Follow the steps in this support article for alternative ways to get a verification code and sign in with two-factor authentication —> Get a verification code and sign in with two-factor authentication - Apple Support
Try “Get code another way.”
On the verification screen, tap: “Didn’t get a verification code?”
Then choose:
Send via Text
Call this number
Use another trusted device (an Apple device that you have used with this account previously).
Make sure your telephone number is one from the country to which your account is set and that you are in that country.
If you find you can’t receive verification codes, you can request account recovery (get Apple’s own instructions in this article: What to expect during account recovery - Apple Support ) to regain access to your account. Account recovery might take a few days or longer, depending on the specific account information you can provide to verify your identity. One tip to using account recovery is to look for options in small blue letters beneath the normal log-in items if you cannot complete the requested information.
Here are links to posts by Community contributors which provide additional detail about the account recovery process and what to do if you do not receive a text or call: Activation Lockout Issues - Apple Community and How can I reset my Apple Account password? - Apple Community and How to delete Apple ID when you can't log… - Apple Community This thread outlines the multi-step process and final recovery —> My Apple ID is locked, how do I fix it? - Apple Community , and this one about things you should and should not do while waiting —> How can I recover my Apple ID after multi… - Apple Community This is a very long user contributed document about account recovery —> Apple Account Recovery: Complete Step-by-… - Apple Community