With the installer CD/DVD its even easier:
Resetting a forgotten Mac password is easier if you have an installer disk handy:
Boot from the Mac OS X installer disk by inserting it into the Mac and holding down the “C” key on boot.
Select your language preferences and then under the “Utilities” menu select “Password Reset” (it may say “Reset Password” instead, depends on the version of Mac OS X)
Select the hard disk that the forgotten password is on, then select the username of the forgotten password, you’ll then be asked to select a new password
Reboot as usual from the hard drive, using your newly reset password as the login!
This is obviously an easier method but it’s of no help if you own a MacBook Air with no DVD drive, or if you just don’t have the installer Mac OS CD laying around. In that case the other answer mentioned would be more appropriate.