Two-step verification (also called two-factor authentication, 2FA or MFA) asks for a second proof when you log in, usually a short code. Many US services send the code by text to a US phone number, which newcomers do not have yet.
Your options, from best to weakest
Authenticator app (for example Google Authenticator, Microsoft Authenticator, or the one built into your password manager). It creates codes on your phone without any SIM card or signal. Login.gov and many banks support it.
Security key: a small USB or NFC device you plug in or tap. Very safe, costs money.
Backup codes: one-time codes a site gives you. Print them or write them down and store them safely.
Text or voice codes: convenient but weaker. Codes can be stolen by SIM swaps.
Use an authenticator app wherever it is offered.
Keep your home SIM active (or an eSIM) for accounts back home. See the guide on keeping your home number.
Many US banks and some government services do not accept internet phone numbers (VoIP) like Google Voice for codes. A real US mobile plan, even a cheap prepaid one, solves this.
When you get a US number, add it to every important account, then remove numbers you no longer use.
Before changing your phone or number
Log in to each important account (email, bank, Login.gov, ID.me, USCIS) and add the new number or app first.
In your authenticator app, move or export accounts to the new phone before you reset the old phone.
Keep backup codes until you have checked that you can sign in.
Banks, USCIS, the IRS and tech support never call to ask you to read them a code. Anyone who asks for one is trying to take over your account.
Setting a friend's US number as your code number.
Wiping your old phone before moving the authenticator app.
Letting your US prepaid plan expire and losing the number that receives your codes.