Back up and restore your Mac
To keep your files safe, it’s important to back up your Mac mini regularly. The easiest way to back up is to use Time Machine—which is built into your Mac—to back up your apps, accounts, preferences, music, photos, movies, and documents (it doesn’t back up the macOS operating system). Use Time Machine to back up to an external storage device connected to your Mac mini, or to a supported network volume. For a list of devices supported by Time Machine, see the Apple Support article How to reinstall macOS from macOS Recovery.
Important: Advanced users may want to create a bootable installer to reinstall macOS in the future. This can be useful if you want to use a specific version of macOS. See the Apple Support article What to do before you sell, give away, or trade in your Mac.