If the laptop is running macOS 10.7+, then you can boot into Recovery Mode using Command + R. Click on the Utilities menu and select "Change Password" or possibly it is "Reset Password". If you are running macOS 10.6 or earlier, then boot from the OSX DVD to do the same thing.
FYI, if you did not enable Filevault, then all you need to do is remove the hard drive and use a USB to SATA Adapter, drive dock, or enclosure to connect the drive to another Mac. Or you can put the old laptop into Target Disk Mode to connect it to another Mac to access the data.
Here is what Apple recommends users do when selling or disposing of a Mac, however, the instructions in the last step (#7 ?) assumes the laptop has Filevault enabled or the laptop is using an SSD, otherwise the simple erase procedure will leave behind all your personal data which can be retrieved by using a data recovery app. If Filevault was not enabled, then when you use Disk Utility to erase the hard drive, you should use the "Advanced" or "Secure Erase" options button (I forget how it is labeled in the older operating systems) and write a single pass of zeroes to the hard drive before selecting the "Reinstall/Install OSX option". Also depending on the currently installed OS it may be easiest/necessary to use the OSX 10.6 Snow Leopard DVD.
What to do before you sell, give away, or trade in your Mac - Apple Support
If this is a first generation white 2006 Core Duo Macbook (not Core 2 Duo), then macOS is the only option for it. However, if you have a second generation or later 2007+ MacBook or MacBook Pro, then another option to extend the useful life of the laptop is to install Linux on it. Linux works well with as little as 4GB of RAM, but can also be used with as little as 3GB (maybe even 2GB). Do NOT install Linux to a Core Duo MacBook 2006 as it will brick it since the system firmware has problems (I don't think many of the Linux USB installers even support a 32 bit only computer these days anyway which is what the 2006 Core Duo CPU was). You can check the system specifications sticker in the battery bay located beneath the battery. Linux is not for everyone plus it requires you to learn a new OS. You can even test drive Linux by using the "Live" mode option on many of the Linux USB installers.
Linux Mint is a good option if you are not familiar with Linux. Kubuntu or Ubuntu-MATE are also options. These particular distributions will work well on older computers with more limited resources. The other Ubuntu flavors either require a more powerful computer with more resources or the interface will be too simple/displeasing for macOS users. You can use the downloaded .iso file as a source for Etcher (Mac/Windows/Linux) which can create a bootable Linux USB installer. Option Boot the laptop and select the orange icon labeled "EFI" which will be the USB Linux installer.