In the event you forget your passcode, your iPhone or iPad will have to be completely wiped, and you will lose everything on the device. This problem can be sorted by backing up the iOS device in question every so often. A backup needs to be taken about once a month, or more often if you use the device a lot. iOS devices should back up automatically when plugged in and locked, but to manually start a back up follow the steps below:

  1. Open the Settings app.
  2. Tap on the Apple ID the iOS device is signed into. This could be your name, or the name of the scheme the iOS device is used in (e.g. Peace IV).
  3. Tap on iCloud
  4. Scroll down to iCloud Backup, and make sure iCloud Backup is enabled.
  5. Tap Back Up Now, and the backup will begin.

The backup should take a minute or so, longer if you store a lot on the device. If you forget your passcode, the device can be restored to the most recent backup taken.