The attacker convinces your mobile carrier to move your number to their SIM. Use an authenticator app or security key for 2FA instead of SMS, and set a PIN with your carrier.
Wallets & security
SIM swap
In shortAn attack where someone takes over your phone number to intercept SMS codes and reset your accounts.