Resetting or changing a password:
For Snow Leopard or earlier: http://support.apple.com/kb/HT1274
For Lion or later: http://support.apple.com/kb/HT6022
This is also useful:
If it's running Mac OS X 10.6.8 or earlier, insert a Mac OS X install DVD, restart with the Option key held down, click on it, and use the Reset Password utility.
If it's running Mac OS X 10.7 or newer, restart with the Command and R keys held down, open the Terminal, and use the resetpassword command: