If you are on Lion or newer, follow directions here:
Reset 10.5 Leopard & 10.6 Snow Leopard password
1. Power on or restart your Mac.
2. At the chime (or grey screen if your chime is turned off), hold down Command+S on your keyboard to enter single-user mode.
3. This step is optional, but it’s a good idea because it checks the consistency of the hard disk before moving on. At the prompt, type fsck -fy and press Enter/Return. Wait for the checks to complete before going to the next step.
4. Type mount -uw / and press Enter.
5. Type launchctl load /System/Library/LaunchDaemons/com.apple.DirectoryServices.plistand press Enter.
6. Type ls /Users and press Enter. This lists all of the usernames on the computer – helpful if you don’t know or remember what these are.
7. Type dscl . -passwd /Users/username password and replace “username” with one of the users displayed in the previous step. Replace “password” with a new password of your choice. Press Enter.
8. Type reboot and press Enter.