Let me show you how to do that.
Set up iPhone’s built-in two-factor authenticator on iPhone
In the steps below, I will show you how to set up 2FA for Facebook. The steps for any other website or app are almost similar. After setting this up, your iPhone will automatically fill in the 2FA code when you sign in to the concerned site. Ensure to add the password for Facebook (or the app/website in question) to your iCloud Keychain. Open Settings → Passwords → scroll down the list or use the search box to confirm you have the details for Facebook (or the app/website) added here. Once confirmed, follow the steps below.
Delete two-factor authentication on iPhone
You must understand that deleting the two-factor authentication would lock you out if you do not turn off the 2FA feature first. Therefore, first, open the app or website in question (like Facebook) and turn off two-factor authentication. Next, follow the steps below to remove the 2FA verification code from iPhone Settings. This is how you can use the built-in authenticator in iOS, iPadOS on iPhone and iPad. If you follow the initial steps on a computer, tap Scan QR Code to scan the QR you see on the computer screen. Have further questions? Please ask via the comments section below. Read next:
How to set up two-factor authentication (2FA) for Apple IDHow to change Apple ID security questionsTips to make your iPhone safe and secureHow to use background sounds on iPhone