If you want to erase/factory reset an iMac and ensure that the previous owner's Apple ID is completely removed, you should follow these steps:
1. Start by restarting your iMac and holding down the Command (⌘) and R keys simultaneously until the Apple logo appears. This will boot your iMac into macOS Recovery mode.
2. In macOS Recovery, you'll see a list of utilities. Choose "Disk Utility" to open the Disk Utility application.
3. In Disk Utility, you should see a list of drives and volumes on the left-hand side. Typically, the main startup drive is named "Macintosh HD" or something similar. This is the drive you'll want to erase.
4. Select the drive (e.g., Macintosh HD) from the list of drives (not the individual volumes beneath it) and click on the "Erase" button in the Disk Utility toolbar.
5. In the Erase dialog box, choose a name for the drive (you can keep the default name) and select the appropriate format (usually "APFS" or "Mac OS Extended (Journaled)"). Then, click the "Erase" button to begin the erasing process. Note that this will delete all data on the drive, so make sure you have backed up any important files.
6. Once the erasing process is complete, close Disk Utility and choose "Reinstall macOS" or "Reinstall OS X" from the macOS Utilities window. Follow the on-screen instructions to reinstall the operating system on the newly erased drive.
By erasing the main SSD (Macintosh HD) using Disk Utility, you should effectively remove all data and user accounts associated with the previous owner, including their Apple ID. The reinstallation of macOS will set up the iMac as if it were brand new, allowing you to create your own user account and configure the system to your preferences.
It's worth noting that erasing the drive at the top of the hierarchy in Disk Utility (Macintosh HD) is generally sufficient to remove all personal data. However, if you want to be extra cautious, you can erase other volumes and partitions as well. Also, you can try 3rd party data erasure tool like BitRaser File Eraser that will help you securely erase data from any storage device, beyond the scope of recovery.
Remember to back up any important data before proceeding with the erase and reinstall process, as it will permanently delete all data on the selected drive.
[Link Edited by Moderator]