Instructions
CAUTION: After following these steps, 10 consecutive failed passcode attempts will cause all of your personal data to be completely wiped from the device and will not be recoverable.
1) Open the Settings app.
2) Tap Face ID & Passcode.
NOTE: For devices with Touch ID, tap Touch ID & Passcode.
3) If a password is currently in use on the device, it will have to be entered when "Face ID & Passcode" or "Touch ID &Passcode" is tapped.
4) Scroll all the way to the bottom. Next to "Erase Data", slide the switch to the "on" position (to the right).
5) Tap Enable.
Outcome
Once this setting is enabled, all personal data on your iPhone or iPad will be erased if 10 consecutive bad passcode attempts are entered.