What To Do When You Forgot Your Password?

How do I unlock my iPhone if I forgot my password?

If you can't remember your passcode when you try again, use a computer to put your iPhone in recovery mode. Recovery mode allows you to erase the iPhone, giving you access to set it up again. After you've erased your iPhone, you can restore your data and settings from a backup.

View complete answer on support.apple.com