You are describing starting account recovery for two factor authentication.
Can you get a verification code another way? See Get a verification code and sign in with two-factor authentication - Apple Support
Can you try to update that Trusted phone number? See manage your trusted phone number at hhttps://support.apple.com/en-us/HT204915#trusted
If you cannot do either of these options you’ll need to figure out the Trusted trusted phone number you originally used. Check with your current and past carriers, friends and family. Once you know the phone number continue with account recovery.
How to use account recovery when you can’t reset your Apple ID password - Apple Support
When going thru the account recovery steps you 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)
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.