Try these checks in order:
- Do not keep requesting new codes repeatedly. Too many requests can trigger a temporary block and Microsoft may stop sending codes for a period of time.
- Check spam/junk folders if the code should arrive by email. Valid verification emails come from @accountprotection.microsoft.com.
- Check the correct mailbox or phone:
- For email, codes are sent only to the primary alias or another email already added as a sign-in verification method.
- For phone, make sure the number is correct.
- Check phone settings:
- If texts from unknown numbers are blocked, disable that block and choose I don't have a code to request another one.
- If the inbox is full or the messaging app is not working correctly, clear storage or fix the messaging app.
- If the number is a VOIP number, it cannot be used for verification codes. Use a mobile number instead.
- Check whether the security info is correct:
- Sign in to the Security basics page: Sign in
- Select Update info.
- If access to the listed phone or email is lost, select I don't have any of these during sign-in and follow the prompts to replace the security info.
- If a message says “make sure you can receive a security code”, verify or add new security info. This can be skipped for 24 hours at a time, but after 7 days it must be completed before sign-in continues.
- If the issue continues, use the Microsoft Sign-in helper: Sign-in helper
Important:
- Microsoft may temporarily delay or block code delivery because of unusual activity or heavy compromised traffic from a location. These cases are automatically resolved after some time.
- Support agents are not allowed to send verification codes or change account details.
- Do not change all security info at the same time, because the account may be restricted for 30 days.
References: