This article, although written in 2012, is still relevant. There is one universal method that works in any case. This requires a computer with iTunes installed. If it doesn't suit you, read the new instructions on what to do if you forgot your password for iPhone. It considers two more options.
interesting 6.1-inch iPhone 12 and iPhone 12 Pro will go on sale first Apple will announce the launch of iPhone 12 from day to day
First of all, save all data from the device. Connect iPhone to your computer, make a backup or save data from iCloud. This can be done from a computer; access to the phone is not required in this case.
Now you need to restore the firmware. This action will remove the password from iPhone. But normal recovery cannot be done if the device is locked. To bypass this limitation, you need to transfer iPhone to DFU mode (simultaneously press the power button and the Home button for ten seconds. When the logo Apple appears on the screen, release the power button, but continue to hold the Home button ).
You will see a message on your computer screen: “iTunes has found iPhone in recovery mode”. Now you can click the “restore” button and wait for your phone to be restored. Synchronization will restore all the data that was on the phone. You will receive the device the same as you entered it in DFU mode, but without the lock password.