There is a nice feature built into the iPhone that, once enabled, will automatically wipe the device clean if someone tries too many times to gain access to it by putting in the wrong passcode.
Why is this useful? Well, for starters if you ever lose your iPhone, anyone that finds it will not be able to keep guessing passcodes. After 10 failed tries the iPhone would wipe itself and clear off all your personal data. Which, in my book, is a good thing.
Obviously, you will want to make sure you have backups turned on and if you have any youngsters in the house this is probably not a setting that you want to turn on.
To enable this feature go to Settings, then Touch ID & Passcode. Scroll to the bottom and turn on the setting for Erase Data.