To tack on to den.thed's response re not doing it yourself I took my Mini M4 into the Apple Genius Bar to have them do the job due to my failing eyesight.
It took them about 45 minutes to wipe the drive clean and install the latest system -Sequoia. I took the Mini home, plugged in my Time Machine drive and completed the installation with Migration Assistant migrating my user data, system settings, apps and documents from the TM backup.
Note: if you take it into a Genius Bar be sure to know your user account user name and password and your iCloud user name and password. You'll need both.
