This wikiHow teaches you how to delete all data, files, applications, and settings from a Mac computer.
Step
Method 1 of 2: For OS X 10.7 or Newer Version

Step 1. Make a backup of the data you want to save
Emptying the Mac computer will delete all files, including the operating system. Therefore, it's a good idea to keep a backup of your files on an external hard disk or DVD.

Step 2. Open the Apple menu
It's a black apple icon in the upper-left corner of the screen.

Step 3. Click Restart…
This option is at the bottom of the menu.

Step 4. Click Restart to confirm
After that, the computer will shut down and restart.
Wait for the computer to turn off

Step 5. Press and hold the key combination +R while the computer restarts

Step 6. Release the buttons when the Apple logo appears
After that, the " macOS Utilities " window will be displayed.

Step 7. Click Disk Utility
This option is at the bottom of the list.

Step 8. Click Continue
It's in the lower-right corner of the window.

Step 9. Click the Mac hard drive
The disc is displayed in the upper-left corner of the window in the "Internal" section.

Step 10. Click Erase
It's in the top-center of the window.

Step 11. Give the disk a name
Type a name in the " Name: " field.

Step 12. Click the "Format: drop-down menu" ".

Step 13. Choose a format
To reinstall the MacOS system, select:
- “ Mac OS Extended (Journaled) ” for fastest emptying.
- “ Mac OS Extended (Journaled, Encrypted) ” for safer deletion.

Step 14. Click the Erase button
It's in the lower-right corner of the dialog box. After that, the deletion process will begin.
The length of time it takes to empty a disc is determined by the size of the disc, the amount of data stored, and the format selected (encrypted or not)
Method 2 of 2: For OS X 10.6 or Older Version

Step 1. Make a backup of the data you want to save
Emptying the Mac computer will delete all files, including the operating system. Therefore, it's a good idea to keep a backup of your files on an external hard disk or DVD.

Step 2. Insert the installation disk
Insert the DVD or installation CD that came with the computer's purchase package into the disc drive and wait for the computer to recognize the disc.
If you are using a USB drive (USB drive) instead of a mount disc, attach the driver to the computer

Step 3. Open the Apple menu
It's a black apple icon in the upper-left corner of the screen.

Step 4. Click Restart…
This option is at the bottom of the menu.

Step 5. Click Restart to confirm
After that, the computer will immediately shut down and restart.
Wait for the computer to turn off

Step 6. Press and hold the C key when the computer restarts
If you are using a USB drive instead of a mount disc, press the Option key

Step 7. Open Disk Utility
This option is in the " Utilities " section of the installation menu.

Step 8. Click the Mac hard drive
The disc is displayed in the upper-left corner of the window, under the “Internal” section.

Step 9. Click the Erase tab
This tab is at the top of the page.

Step 10. Give the disk a name
Type a name in the " Name: " field.

Step 11. Click the drop-down menu Format: ".

Step 12. Choose a format
If you want to reinstall OS X, select: “ Mac OS X Extended (Journaled) ”.

Step 13. Click Erase
It's in the lower-right corner of the dialog box. After that, the deletion process will begin.