Hi Alikaliesesay,
Usually the simplest option is to move your SIM card to the replacement device, presuming that phone number is configured as a trusted number in order to receive codes by text.
If that is not the case and there is no trusted phone number or email address configured, you can attempt the steps in If you forgot your Apple ID password:
"If you have a new Apple device
If you have a new Apple device or an Apple device that you aren't signed in to with your Apple ID, you can select "Forgot password or don't have an Apple ID?" wherever the option appears.
During device setup, you can find the "Forgot password or don't have an Apple ID?" option on the Apple ID sign-in screen.
After setup, you can find the "Forgot password or don't have an Apple ID?" option in Settings:
- iPhone or iPad: Go to the Settings app and tap Sign in to your iPhone. Then tap "Forgot password or don't have an Apple ID?" and follow the onscreen instructions."
Barring that you may have to use the account recovery process as described in How to use account recovery when you can’t reset your Apple ID password to regain access to the account. Once access is reestablished, update the account with trusted phone numbers, email addresses and set up a Recovery Contact per Help a friend or family member as their account recovery contact to protect against this situation in the future.
Regards.