Don't panic, you won't be locked out. There are simple steps you can take to fix this.
For iOS devices:
When you reach a maximum of 5 goes, you won't be able to use Touch ID or Face ID. Instead, you can just manually enter your password. If you lock and unlock your device using your passcode, the 'Use Touch ID' option will come back. You can also still use your password at any time.
For Android devices :
When you reach a maximum of 5 tries, you'll see a message that you've used too many attempts. You'll then have to wait a minute until you can try using your fingerprint again. You'll still be able to use your password at any time though.