First, not all 2FA is equally secure. At the very least your 2FA should be an open source authenticator app (not Google Authenticator) such as andOTP, Aegis, or Tofu. Even better than that would be a physical 2FA key, such as a YubiKey or a hardware wallet. You should never use a code sent to you by email or SMS as your 2FA. Emails are frequently hacked, and if an attacker can access your email account, use that to reset your online account password and receive the 2FA code, then that isn't two factors that need to compromised at all. The compromise of one factor (your email account) allows an attacker to access both pieces of information for your 2FA. SMS messages are sent unencrypted, can be intercepted, and phone numbers can be transferred to another SIM with some very straightforward social engineering.
Second, if your wallet offers 2FA as discussed above, that means you are probably logging in to your wallet account,* which means it is a web wallet or an exchange. These kind of online wallets are the absolute lowest in the terms of security, and should be avoided. If you want to protect your coins from hackers, then store your keys offline on either an airgapped device or a hardware wallet.
*Unless the 2FA is a multi-sig wallet where you store your own keys but a third party co-signs your transactions.