When you format a computer, you will lose all of your files and data. The programs can’t be backed up; they will need to be reinstalled. Any files—including documents, music, pictures, and videos—that you want to save need to be copied to a backup location. You can use DVDs, CDs, external hard drives, flash drives, or the cloud, depending on how much data you have to backup. While the computer is rebooting, hold down the Command + R keys. This will open the Recovery menu. Select Disk Utility and click Continue. Select your hard drive from the left frame in the Disk Utility. Select the Erase tab. In the Format dropdown menu, select Mac OS Extended (Journaled). Enter any name you would like and then click Erase.  All of the data will be deleted from the disk at this point. Make sure you have properly backed up any important files. Close Disk Utility after the Erase process is complete. Verify that you are connected to a network and select Reinstall Mac OS X. You will need to verify your license by entering your Apple ID and password. You will also need to accept the license agreements. The installer will prompt you to select a disk to install the OS to. Select the disk that you just erased using Disk Utility. Mac OS X will begin installing itself, and requires no input from the user. The computer may reboot during the installation process. After installation is complete, the desktop appears.

TL;DR in Vietnamese:
Sao lưu dữ liệu. Khởi động lại Mac của bạn. Định dạng lại ổ đĩa của bạn. Bắt đầu quá trình cài đặt Mac OS X. Chọn ổ đĩa để cài đặt. Đợi quá trình hoàn thành.