Apple makes it fairly difficult to do a clean installation of OS X on a Macbook, primarily by providing misleading completely false instructions in their help.
If you make a new account (e.g. for a work laptop), you should try to sign into it in iCloud and the App Store on the laptop, if possible, before reinstalling the OS. Apple seems to require a credit card attached to the account.
Make sure you have time + power available to repeatedly download several multi-gigabyte installers. These instructions will allow you to install the OS clean – you cannot do a factory reset without these, as it will keep all the files and applications currently present on the device.
The general process for doing a clean install of the OS is as such:
- Update the OS to the latest version1. This attaches the latest version of the OS to your account, without which you cannot reinstall. You cannot follow this process without updating the OS to the latest version, because there is no way to download the installers for non-current versions.
- Re-download the OS from the “Purchased” tab of the app store. This downloads the installer for the OS (normally this is discarded)
- Get an 8 GB USB drive, and reformat it through the OS.
- Use Diskmaker2 to write the OS installer onto your USB drive.
- Reboot the machine. While it restarts, press CMD-R.
- This takes you into the OS install screen. Do not reinstall here – this forces you to redownload the OS, and it provides no option to format the disk.
- From the menu in the upper right, select to reboot from a startup disk, and select your thumb drive.
- When this boots into the USB mode, it looks exactly the same, except it is possible to install the OS without connecting to the internet. DO NOT INSTALL YET.
- From this screen, select disk management, and format the disk as you desire (e.g. encrypted or not)
- Now, once the disk is formatted, you can re-install the OS without issue. Note that you will need a phone handy to receive text messages, to verify your access.