Your Mac can be backed up using an external hard drive with a built in program in macOS called Time Machine.
Back up your Mac with Time Machine
Use Time Machine to restore deleted files or older files
Restore your Mac from a backup