2 Factor Authentication comes in a number of forms. This is one reason why SIM Swapping? is such a problem. The ideal concept is as follows. You log in through an unknown device. You provide the correct UID/Password combination, but since this is an unknown device, you would have to go one more step in proving you are whom you say you are. This could be as simple as sending an email? or SMS? with a 6 digit code. If a bad actor SIM Swapped your number to their device, they will have a chance of receiving this code.
The best implementation of 2FA will be to use an authenticator app such as Google Authenticator. This will provide a random 6 character number which will change every 30 seconds. The system knows what number should be provided, and the app will give you that number. You have less than 30 seconds to provide that number before it changes. The only disadvantage is if you lose your device, then it would be much harder to get into your account. However, since this design is immune from SIM Swapping, it is not the end of the world if someone steals your telephone number.