If you have reasons to believe that your Apple ID password has been compromised, it is important that you take immediate steps to change your Apple ID password and prevent the possibility of unauthorized access to your iPhone and other devices linked to the same Apple ID.
In addition to this, Apple is also known to prompt users to change password; if it detects multiple failed login attempts, sign-in from a new location, change in personal information, change in security questions and if there is a known data breach.
Also, if your iPhone is company-owned; it may prompt you to regularly change both Apple ID and Email Account password; due to its security policies.
Caution: Security alerts requesting change in Apple ID password may also come from scammers trying to gain access to your personal data.
Change Apple ID Password on iPhone and Mac
When you try to change Apple ID password, you will be prompted to type your current Apple ID password. Hence, make sure that you remember the current password for your Apple ID.
Depending on your personal choice or preference, you can use any of the following methods to change your Apple ID password.
1. Change Apple ID Password on iPhone or iPad
You can change your Apple ID Password on iPhone or iPad by using the following steps.
1. Open Settings > tap on your Apple ID Name.

2. From Apple ID screen, go to Password and Security > Enter your Apple ID Password.
3. On the Password & Security screen, tap on Change Password option.

4. If prompted, answer two Security Questions to verify your identity
5. On the next screen, enter Current Password, New Password and verify the New Password.
2. Change Apple ID Password on Mac
You can also change your Apple ID Password on Mac by following the steps below.
1. Click on the Apple Icon in top-menu bar and select System Preferences.

2. On System Preferences screen, click on Apple ID icon.
3. On the next screen, select Password & Security in the left-pane and click on Change Password option in the right-pane.

4. If prompted, answer Security Questions and click on Next.
5. On the next screen, enter your Current Password, New Password, Verify New Password and click on the Change button.
3. Change Apple ID Password on Any Device
As mentioned above, you can change Apple ID Password by going to Apple ID page on a Windows computer.
1. Go to Apple ID website and Sign-in to your Apple ID Account.
2. You may be prompted to answer two security questions.
3. On Mange Apple ID screen, scroll down to Security section and click on Change Password option.

4. Enter your Current Password, New Password, confirm New Password and click on Change Password button.