https://appleinsider.com/inside/macos/tips/how-to-use-macos-erase-assistant-to-reset-your-mac
..If you want to reset your Mac to its original state to start from scratch, you can use the macOS Erase Assistant to do it. Apple also created this app to make it easy for anyone who wants to sell, give away, or trade in their Mac to erase it using minimal steps…
As a standalone app, it lives hidden away on your Startup Disk at /System/Library/Core Services. However, it also gets run by the system via the System Settings app..
Also, see Apple’s page
titled What to do before you sell, give away, trade-in, or recycle your Mac for more info on the Erase Assistant.That page lists the requirements to use the Erase Assistant, namely that the Mac must be an Apple Silicon-based Mac, or a Mac with a T2 Security chip in it. It also must be running macOS Monterey or later…