You are wise to perform a clean install to make sure the file system & OS are clean & fresh and free of any issues. It also ensures that the Mac doesn't have a firmware lock.
Here is what the previous owner should have done before selling the laptop:
https://support.apple.com/en-us/HT201065
What is the exact model of this Mac and what version of macOS is installed? To get the exact model of the Mac enter your serial number here or here.
If you have a 2010+ Mac which had macOS 10.12.6+ installed at some point in the past, then you should be able to boot into Internet Recovery Mode using Command + Option + R which in theory should boot to the latest supported online macOS installer (sometimes it will only boot to the OS which originally shipped with the Mac from the factory). Using local Recovery Mode (Command + R) will boot the installer from the hard drive which will be tied to the previous owner and will not work for you.
If you have access to another Mac, then you can create a bootable macOS USB installer.
Make sure to erase the whole physical drive. With later versions of macOS Disk Utility hides the physical drive from view. Within Disk Utility you need to click on "View" and select "Show All Devices" so that the physical drive appears on the left pane if Disk Utility as shown in this Apple article:
https://support.apple.com/guide/disk-utility/erase-and-reformat-a-storage-device-dskutl14079/mac
If you are booting a macOS installer for 10.6 to 10.10, then here is how you properly prepare the drive (partition & format):
https://www.owcdigital.com/assets/support/support-formatting-and-migration/Mac_Formatting_6-10.pdf
For really old Macs you may need an OSX 10.6 Snow Leopard DVD if the Mac shipped with installer DVDs from the factory. If you provide us the exact model we can provide more details if the other options don't work out.