You’ll need to start account recovery t to o Update both the phone number and password. While their online support article says for forgotten password, account recovery steps are also for a new phone number if you can’t sign in to update the number. https://support.apple.com/en-us/HT204921
When going thru the account recovery steps you’ll need to first enter in that old number to show you know it. Then when you get to the step where it says it sent a code to that old number select the option most like “didn’t get code” and it will let you continue with your current number.
Always scroll down for additional options in small blue print if the  ones showing don’t apply to/work for you.
When starting the account recovery steps the credit card is an extra option and not required. (See prior tip)
Lastly snd very important, Account recovery is a two phase process once started. Phase 1 is the evaluation period, usually 24-48 hours but can be longer or shorter. This phase says Apple is evaluating your info and you’ll get an update after the posted time is over (people mistakenly think it means they’ll be able to reset the password immediately after this first phase.)
Once phase 1 is done it enters phase 2 where https://iforgot.apple.com/ will give you the final amount of days (can be weeks) you’ll wait. On that final day you’ll get a text, follow that text/email immediately.