What is the exact model of the laptop and the version of macOS you are trying to install? You can get the exact model by entering the serial number here:
Check Your Service and Support Coverage - Apple Support
If your laptop uses a third party NVMe SSD, then you will need to boot into a macOS 10.13+ installer. Try booting into Internet Recovery Mode (Command + Option + R) to attempt to boot into the latest version of the online macOS installer.
If you have not erased the drive yet and the laptop still boots normally, then I highly recommend you create a bootable macOS USB installer using the instructions in this Apple article as it will give you more options in case Internet Recovery Mode has issues during the install:
How to create a bootable installer for macOS - Apple Support
Does your laptop use a hard drive or an SSD? Is Filevault enabled? This is very important to know when destroying your personal data on a Mac as extra steps may need to be used since Apple's instructions assume an SSD or Filevault. Here are some things you should do prior to erasing the Mac when selling a Mac:
What to do before you sell, give away, or trade in your Mac - Apple Support