There are many reasons why your iOS device will reject a password, from typing mistakes to problems with Apple. How do you quickly fix it?
If your iPhone or iPad keeps asking for the password but you've used it successfully before on this device, then there's one answer: “turning it off and on again.”
Specifically, logging out of your account and then logging in again. How you log out depends on what you have been trying to do.
App Store Login Problems
If you were trying to purchase an app (or download a free one), then log out of the App Store (tap your Apple ID in Settings > iTunes and App Store).
iTunes Login Problems
If you were trying to purchase music or a movie, then log out of iTunes (tap your Apple ID in Settings > iTunes and App Store).
iCloud Data Login Problems
If it seems like Apple was asking for a password that might be related to iCloud data (photos, calendars, iCloud Drive), then instead try shutting down your iPhone (press and hold the sleep/wake button until you see the slider). Then restart the phone.
If you’re looking for a quick fix, do not log out of your iCloud account. Doing so will force you to decide whether or not to keep all the iCloud data on your phone, and both answers may create problems. If you choose to delete the data from your phone you can always download it from iCloud again (after all, an iPhone without data isn't too useful), but it can take a while to put all that data back on your phone.
And if you choose to keep the data on your phone when you log out of iCloud, you could be setting yourself up for sync problems later.
In short, don't log out of iCloud when you're looking for a quick fix.
Don't Ask Why It Works
Did that fix the problem? Great! Move on and don’t ask why. Occasional login problems are nothing to worry about.