To boot the Mac into recovery mode, restart and hold down the Option key, and select the recovery partition of the Mac
To reset the password:
resetpassword