If you know your current user account password, you can change it from the Users & Groups pane of System Preferences.
If you're entering your password ( and you're sure that it is the correct password), but it's not working at the login screen, check to make sure the Caps Lock key is off. Passwords are case sensitive. If you see the Caps Lock indicator in the password field but your password isn't all capital letters, press the Caps Lock key on your keyboard to turn this off. If this is not the problem try turning off the computer and restarting.
If you don't remember your current user account password, try a blank password at the login window to see if it logs you in or gives you a hint. You can also use an administrator account you have a password for, or try the Password Recovery Assistant to change or reset a user account password.
If you forgot your user account password, start up your Mac and try to log in. If you don't remember your password, leave the field blank and press Return. If your password is blank, this logs you in. If your password isn't blank and you previously set up a hint, the hint button (?) appears. Press the hint button in the password field to see your hint. If you remember your password based on this hint, try to log in with it. It's generally not a good idea to have a blank password. If you're able to log in when you leave the password field empty, use the steps at the beginning of this article to change your user account password to something that isn't blank. You can then set your Mac to log in automatically instead.
If you've set up more than one user account on your Mac, you can log in as an administrator to change user account passwords for other users. From the login window, log in using an administrator account that you know the password for. Open System Preferences and click the Users & Groups icon. Click the lock icon in the preferences window if it's locked. Then enter your administrator name and password at the prompt. Select the user name of the account you want to change from the list of users. Click the Reset Password button, then follow the onscreen prompts.
After you change a user's password as an administrator, the user also needs to update or reset the login password in the Keychain the next time the user logs in.
If your startup disk is encrypted with FileVault, you can enter your Recovery Key as your password or you can restart your Mac to use the Password Recovery Assistant. Use these steps to open the assistant: Wait a few moments at the login screen without typing your password. A prompt should appear telling you that you can turn your Mac off and back on again to recover your password. Press and hold the power button for three seconds to turn your Mac off. Press the power button normally to turn your Mac on. When the Reset Password window appears, follow the onscreen prompts to get help logging in.