Before you wipe a computer, make sure that you have a backup of any files you need and deactivate any software that requires doing so. For Macs, Apple recommends logging out of any iCloud services, including iTunes and iMessages.
Next, figure out which type of storage your computer has. On Windows, this information is harder to find than it should be, but the easiest way is to open the Defragment and Optimize Drives tool (type “defragment” into the search menu in the taskbar). On a Mac, click the Apple logo and then About this Mac, and select the Storage tab. The entry typically says “solid state” or “flash storage” for a solid-state drive (SSD), whereas for a mechanical hard drive it says “hard disk drive.”
The following directions for wiping a computer will work with any system running Windows 10, as well as most Macs. If you have an older copy of Windows or if you like to get into the weeds with different file-deletion methods, a third-party tool like Dban is your best option.