Hello, thank you for reaching out to Microsoft Q&A.
Could you please let me know if you have any other verification methods available, such as an email address or an authenticator app, to verify your identity?
Have you checked your phone’s message settings to see if it is blocking texts from unknown numbers? Please also check your phone’s blocked senders list to see if the number from Microsoft is included. If it is, you can remove it from the list and try requesting the verification code again.
In some cases, the block may be tied to a specific network. Try switching your PC to a different network, such as a mobile hotspot, and see if you can receive the verification code.
If you are still having issues, you can submit the Account Reinstatement form to the Microsoft account digital safety team.
Select "I am not receiving the provided code" and click Submit.
https://www.microsoft.com/digitalsafety/account-reinstatement
For reference, see
Troubleshoot Microsoft verification code issues