first of all we need to do the following preparatory work:
-Prepare a 8GB or more U disk (in the process of making system installation disk will be a U disk format, please make sure there is no important data in the U disk).
-Find OS X El Capitan in the Mac's App Store and choose to download it (don't install it after downloading).
The specific actions are as follows:
1. Insert a U disk into the MAC, open the Disc tool, select the USB disk.
2. Select the "Erase" option to rename the U disk to untitled and erase it.
3. Open the terminal, enter the following code in the application, press ENTER to confirm.
Sudo/applications/install OS X El capitan.app/contents/resources/createinstallmedia--volume/volumes/untitled-- Applicationpath/applications/install OS X El Capitan.app--nointeraction
Next, you will be prompted to enter a password, which is your computer password. After waiting for the command to run and show done, the system boot disk is finished.
4. Restart the MAC, hear the power-on start tone after the option key, in the disk selection interface to select a U disk to start, press ENTER to confirm.
5. The system will then enter the OS X utility, first select Disk utility and prepare to format the hard drive.
6. Select the internal hard disk in Disk utility and click the Erase option to format the hard drive.
7. After the format is completed, exit the disk tool, select "Install OS X" and install the system on your internal hard drive.
8. The next thing we need to do is to wait for the system to be fully automated.