Here is how I suggest you do a clean install:
1) VERY IMPORTANT - BACKUP! You are about to erase your system drive. Never do that without a backup - well, actually, you should have at least two... I recommend a Time Machine on one drive, and a full clone of your system drive in a separate one.
2) Download the full Big Sur installer from the App Store. If the installer starts automatically, quit it.
[if the OS you want to install is an older one, like Catalina, Mojave or High Sierra, use this link instead: https://support.apple.com/en-us/HT211683]
3) Create an installer drive on a thumb drive, following the instructions here:
How to create a bootable installer for macOS - Apple Supportsupport.apple.com › en-us
4) On recent macs, you may need to authorize booting from an external drive, which may be disabled by default. You do this in "Boot Security Utility".
Information about this is available in this support document:
https://support.apple.com/en-us/HT208198
---- do not proceed further without a backup!!!! ----
5) Restart your mac holding the Option key, and select that installer disk to boot your mac
6) Use Disk Utility to reformat your internal drive as APFS
7) Quit Disk Utility and start the installer.
8) When asked, choose to migrate content from "another mac, time machine or drive".
IMPORTANT: elect to migrate ONLY user accounts; NOT applications, settings or other files