I personally recommend people perform their own clean install of the OS whenever purchasing a used device even if the previous owner has already done so because it gives you peace of mind that the OS is indeed factory clean and it can also alert you if a firmware password lock has been enabled, and may sometimes alert you whether it is still being managed by a previous owner. If a firmware password is enabled or the Mac is being managed, then you need to return it immediately for a full refund since there is no way for you to disable either one of those things.
A clean install of macOS involves first erasing the whole physical internal SSD (Intel Macs only), followed by installing macOS. I would recommend you create a bootable macOS Sonoma USB installer now while you can boot this laptop since some people have issues with the online installer in Internet Recovery Mode (Command + Option + R).
These 2018 - 2020 Intel Macs are tricky due to the T2 security chip and the new security features. In order to boot to a USB installer, you must first modify the laptop's security settings to allow booting from USB by booting into Recovery Mode or Internet Recovery Mode and using the Startup Security Utility. When you boot to the USB installer, you need to make sure you erase the SSD & install macOS all at the same time since if you reboot a T2 Mac after erasing the internal SSD, I'm not sure whether you will be able to boot to a USB drive again until you install macOS through Internet Recovery Mode.
For a clean install.......While booted to the macOS installer, launch Disk Utility and click "View" & select "Show All Devices" so that the physical drive appears on the left pane of Disk Utility. Select the physical SSD and erase it as GUID partition and APFS (top option). Quit Disk Utility and select "Install macOS".