To change the iPhone password (passcode for the lock screen), follow these steps:
- Open the Settings app on your iPhone.
- Scroll down and tap "Face ID & Passcode" (or "Touch ID & Passcode" on older models).
- Enter your current passcode.
- Scroll down and tap "Change Passcode."
- Enter your old passcode again when prompted.
- Enter a new passcode and confirm it by entering it again.
This will change the lock screen passcode used to unlock the iPhone. If you want to change your Apple ID password, you can do that under Settings by tapping on your name at the top, then "Sign-In & Security," and then "Change Password"—you will need to authenticate with your current password or device passcode before entering the new password. Changing the lock screen passcode protects your device access, while changing the Apple ID password secures your Apple account and services linked to the device.