To remove the iPhone code generator from an account, first disable 2FA on that account. If you remove it from your iPhone's settings first, you'll get locked out of your account, and you'd need to use a backup or recovery code.
For example: you set up 2FA for your Discord account. Disable it there, then proceed to your "iPhone's Settings → Passwords → saved login information → Edit → Delete Verification Code."