This wikiHow teaches you how to reset a Windows laptop or MacBook to its original factory settings. If you want to sell your laptop, or if you just want to start over, restoring factory settings is the best option.
Steps
Method 1 of 2: Windows

Step 1. Connect the laptop
Since the rest of the procedure can take a long time, it's important to make sure it doesn't run out of battery power.

Step 2. Right click on the menu

It is usually located in the lower left part of the screen.

Step 3. Click Settings

Step 4. Click Updates and Security
It's the icon with two curved arrows.

Step 5. Click Recovery
It's in the left column.

Step 6. Click Start under “Restore this PC”
It's at the top of the main panel.

Step 7. Select an option for the files
Choose Keep my files to delete all apps and settings without deleting your personal data, or choose Delete all to get started with a brand new computer.
If you decide to delete everything on the computer, be sure to make a backup first so you don't lose any important files

Step 8. Select to format the disk if you wish
If you're not worried about someone restoring your files, select Just delete my files to skip formatting the drive. If you are giving away or selling the computer, select Delete my files and clean the drive to ensure that all your personal data is completely erased.

Step 9. Click Next in the “Warning
”. Do this only if you want to continue restoring your computer to factory settings.

Step 10. Click Restore
The computer will return to the original settings and delete all the selected data.
If you choose to clean the hard drive, this process could take several hours
Method 2 of 2: macOS
Step 1. Connect the laptop
Since the rest of the procedure can take a long time, it's important to make sure it doesn't run out of battery power.
Step 2. Back up the files to another location
If you don't want to lose your personal data, read backing up a Mac to learn how to use the built-in backup tools. Do not continue with this method until you have made a backup or are completely sure you do not need one.
Step 3. Sign out of iTunes
How to do it:
- Opens iTunes.
- Click on the menu Bill at the top of the screen.
Step 4. Click Sign out
Step 5. Sign out of iMessage
How to do it:
- Opens Posts.
- Click on the menu Posts at the top of the screen.
- Click on preferences.
- Select your account.
- Click on Sign off.
- Click on Sign off to confirm.
Step 6. Close the iCloud session
How to do it:
- Click on the menu
Macapple1 - Click on System preferences.
- Click on iCloud.
- Remove the check mark from "Find my Mac."
- Enter the system password.
- Click on Sign off.
- Click on Clear the data on this Mac.
Step 7. Click on the menu

It's in the upper-left corner of the screen.
Step 8. Click Shut Down
The computer will shut down.
Step 9. Turn the MacBook back on and immediately hold down the ⌘ Command + R keys
Keep pressing these keys until you see the macOS Utilities window.
Step 10. Click Disk Utility
Step 11. Click Continue
Step 12. Click on the MacBook startup disk
It will be in the list of drives in the left column. It is usually called "Macintosh HD".
Step 13. Click Delete
It's near the top center of the screen.
Step 14. Select Mac OS Extended (Journaled) from the “Format” menu
Step 15. Click Delete
The data on the MacBook will be erased. Go to the next step until the process is complete.
Step 16. Click on the Disk Utility menu
It's in the upper-left corner of the screen.
Step 17. Click Exit Disk Utility
You will return to the Utilities window.
Step 18. Click Reinstall macOS
It can also be called Reinstall OS X on some Macs.
Step 19. Click Continue
Step 20. Select a hard drive
It's the one you just formatted.
Step 21. Click Install
MacOS will be reinstalled on the MacBook. When the installation is complete, the Mac will restart with a fresh installation.