Hello, thank you for reaching out to Microsoft Q&A.
Did you check your junk or SPAM email folders and see if you've received the verification code email from Microsoft?
Also, check if your phone isn't blocking the texts from unknown numbers.
If you are still having trouble receiving the verification code, wait for 24 hours and then try again. Sometimes waiting a day can be enough to remove a block. Don't make lots of repeated attempts, as this may reset any time lock. If there's no change after 24 hours, switch to another Wi-Fi network or a device and then try resetting your password.
For reference, see -
Troubleshoot Microsoft verification code issues article for reference.