I'm assuming you have 10.5 Leopard & 10.6 Snow Leopard:
First step. REMOVE all power and the battery from the MacBook, for at least 30 seconds. Then reinstall the battery and power supply.
Power on or restart your Mac.
At system boot/login screen, hold down Command+S on your keyboard to enter single-user mode.
When At the prompt,
Type mount -uw / and press Enter.
Type launchctl load /System/Library/LaunchDaemons/com.apple.DirectoryServices.plist and press Enter.
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.
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.
Type reboot and press Enter.