If your computer starts to slow, you may need to clean it completely. Regularly formatting and reinstalling the operating system will help your computer run better for longer than you think. This will remove junk files and leftovers that slow it down. If you regularly back up your files, the entire process will only take about an hour.
Steps
Method 1 of 2: Windows

Step 1. Obtain or create a Windows installation disc or USB drive
The easiest way to completely clean your computer and start over is to use a Windows installation disc or USB drive. It must be the same version of Windows that you have installed. For example, if you use Windows 7 you will need a Windows 7 installation disc. You can use the installation disc that came with the computer or create one yourself. You will need a blank DVD or USB drive with at least 4GB of storage:
- Windows 7: Use your product key to download the ISO file from Microsoft. Then download the "Windows DVD or USB Download Tool" to create an installation DVD or USB drive using the ISO file you just downloaded.
- Windows 8: Visit the Microsoft Windows 8.1 download page and click the "Create Media" button. Run the tool and follow the instructions to download and create an installation DVD or USB drive.
- Windows 10: Visit the Windows 10 download page and click the "Download tool now" button. Follow the instructions in the tool to download the Windows 10 files and create an installation disc or USB drive.

Step 2. Make a backup copy of the files you want to keep
When you completely clean your computer and reinstall Windows, all the files stored on your hard drive are deleted. Make sure to save any important files to another location like an external hard drive or cloud storage service. You will need to reinstall all the installed programs once you finish the process.
Take a look at How to Back Up Your Files for more information on how to back up your important files

Step 3. Boot the computer from the installation disk or USB drive
Once you have saved everything that is important, you are ready to completely clean your computer and install the operating system. You'll start the computer from the installation disk or USB drive instead of the hard drive. You will need to configure your computer to boot from the installation disk or USB drive that you created. The process is different depending on whether the computer had Windows 7 or an earlier version installed, or Windows 8 or a later version (BIOS against UEFI).
- Windows 7 or earlier (BIOS): Restart the computer and press the BIOS, Setup, or Boot key. This key is usually displayed on the screen when the computer starts before loading Windows. The most common are F2, F10, F11, or Del. Open the "BOOT" menu and configure the DVD or USB drive to be the primary boot device.
- Windows 8 or later (UEFI): Open the "Start" menu and right-click the "Start / Shutdown" button. Hold down the Shift key and click "Restart." Select "Troubleshoot" from the menu that appears and then "Advanced Options." Click the "UEFI Firmware Settings" button to open the UEFI menu. The "Boot" section of the menu will allow you to change the boot order so that the computer starts from the DVD or USB drive.

Step 4. Start the installation process
Press any key on the keyboard when prompted to load the Windows "Setup Program." It may take several minutes to load all the necessary files.

Step 5. Select the language options
Before the installation begins, you will be asked to select your language preferences. Click "Install Now" to begin installation when you have chosen them.

Step 6. Enter the product key
You will be prompted to enter your Windows product key in case you install Windows 8 or later. In case you install Windows 7, you will be asked to enter it when the installation is complete. You can skip this step in case you want to enter the product key later.

Step 7. Select the "Custom" installation option
This will allow you to remove all data from the computer and start over.

Step 8. Select the drive where Windows is installed
It will appear as the "Primary" drive and will usually be labeled for your version of Windows.

Step 9. Click the "Drive Options" button and then "Delete."
This will delete the partition and all the data on it. The drive will become "Unallocated Space".
- It is possible to repeat this with each of the partitions that you want to delete and combine into a single main one. All data on the partitions will also be deleted. Click "Extend" to combine the blocks of unallocated space into a single partition.
- It is possible to divide a partition into several if you want. This is often useful for file organization. Select the unallocated space and click "New" to create new partitions from it. Just make sure the partition you want to install Windows on has at least 20GB of space.

Step 10. Select the partition where you want to install Windows and click "Next"
The Windows installation process will begin. The file copy and installation will take about 20 minutes.

Step 11. Create your user account
When the files are finished copying, you will be asked to create your user account. This account will have administrator privileges. You will also be asked to enter a name for the computer. This is the name by which you will identify yourself on the network.

Step 12. Enter the product key (Wndows 7)
In case you install Windows 7, you will be asked to enter your product key. You can skip this step for now in case you want to enter it later.

Step 13. Choose the "Windows Update" options
Most users should select the "Recommended" option to make sure everything stays up to date and protected.

Step 14. Set the date and time
The computer will automatically select the correct date and time, but you may need to make manual adjustments.

Step 15. Identify the type of network you will connect to
Choose the type of network that best suits your environment. This will affect your network security and sharing options.

Step 16. Start using Windows
When you select the network type, you will be taken to the Windows desktop. In case you have not previously entered the product key, you will be prompted to do so now.
Method 2 of 2: Mac

Step 1. Make a backup of all important files
When you reinstall OS X all your files will be deleted. Make sure to copy all your important documents, pictures, videos, and other files to a safe location like an external hard drive or cloud storage service. Take a look at Backing Up Your Files for more information on how to back up your important files.

Step 2. Restart the computer and hold down the keys
Command + R after the start-up sound sounds. Release the keys when the Apple logo appears.

Step 3. Select the Wi-Fi network you want to connect to
You will be asked to select the network you want to connect to. In case you don't have Wi-Fi, you will need to connect via Ethernet. You will need to have an Internet connection to reinstall OS X.
It is also possible to click on the Wi-Fi icon in the upper right corner and select the network you want to use

Step 4. Open "Disk Utilities" from the "Recovery" menu
This will open a window that will show all the drives installed on the computer.

Step 5. Select your hard drive and click "Delete"
In case you want to, it is possible to leave the settings that appear by default and give the unit a name. Click "Delete" to confirm. Close "Disk Utilities" when the removal process is complete to return to the "Recovery" menu.

Step 6. Select "Reinstall OS X" and click "Continue"
This will open the OS X installer. You will be notified that the computer will be verified by Apple.

Step 7. Read and accept the terms of use of the license
You will need to confirm that you accept them to continue with the installation.

Step 8. Select the drive where you want to install OS X
Choose the drive you just deleted in "Disk Utilities."

Step 9. Enter your Apple ID
You will be asked to enter your Apple ID to verify that you have a license for your operating system.

Step 10. Wait for the files to download
The installer will begin downloading the files necessary to install OS X. The time it takes will depend on your connection speed.

Step 11. Select your region and keyboard
These should be selected correctly by default.

Step 12. Connect to your network
Select your wireless network and enter the password to connect to it. In case you connect via Ethernet, you will not be asked to select a network.

Step 13. Choose to transfer the information
You can restore a "Time Machine" backup or transfer files from a Windows computer. If you choose any of these options, follow the instructions to transfer the files. To set up your computer as new, select "Do not transfer any information now."

Step 14. Sign in with your Apple ID
This will give you access to the Mac Store and your iTunes purchases.

Step 15. Create an account
By default, OS X will use your Apple ID as the computer account. But it is also possible to choose to create a local account instead.

Step 16. Finish the setup process
You will be guided through a few minor setup screens before taking you to your new desktop.