Managing personal Outlook.com account settings, security, and privacy
Hi
Was the old number used to receive security codes, or did you use it instead of your email address to sign in?
If it was for security codes, open https://account.microsoft.com/security, then select “Manage how I sign in” > “Add a new way to sign in or verify.”
If a phone option appears, select it and verify your new number. If it’s missing, add an email address you can access or Microsoft Authenticator instead. Microsoft is phasing out SMS verification, so adding a replacement number may no longer be available for your account.
Microsoft explains this here: https://support.microsoft.com/en-us/accounts-billing/manage/microsoft-account-security-info-verification-codes.