1. Open settings2. Swipe down to go to the Face ID and passcode tab3. Search for “Change Passcode” and click on it4. Enter the passcode you want to set.
Guide to Change iPhone passcode
1. Open settings
2. Scroll down to go to the Face ID and passcode button and select it
3. You will be asked to enter the current passcode.
4. Locate “Change Passcode” and click on it
4.Enter the current password
5.Now enter your new password.
What to do if you have forgotten your password?
The foremost way to obtain your information is via iPhone recovery mode, it is the only way for getting back your data.
Troubleshooting:
Make foolproof you memorize your old passcode because if you are locked out you will have to delete all your data through a personal computer.If not fixed contact apple support.