Like any complex machine, your computer requires maintenance to keep it performing the way it did the first time you started it up. Think of your car - if you never changed the oil, tires, filters, or had anything checked, it probably would not last more than a year or so before you began to notice major problems.
Unfortunately, your computer salesman probably does not send you reminders to maintain the computer the way a car dealer often does (if so, then you have quite a dedicated computer salesman!). The positive side is that computer maintenance is not nearly as expensive, and in fact can be free as long as you are willing to dedicate a little time to the task.
Note: The instructions on this page assume you are running some version of Microsoft Windows. While the principles apply to other operating systems, the steps involve will likely be quite different.
If your hard drive fills up, the computer spends more time searching for the files it needs or finding a place to write a file, and has less "working space" for temporary files. To keep the drive as clean as possible, you should look for files that you have created, but no longer need. These may include documents, photos, saved game files, etc. Removing any unnecessary files first will help to speed up the next few steps.
See Also: Removing Unnecessary Programs
When programs are running, they create "temporary" files on your hard drive to store information. Normally, these files are deleted by the program when they are no longer needed, but a combination of poor design and crashing programs can often lead to thousands of these temporary files being left on your computer. The files are usually very small, but the amount of space in use adds up, and they can eventually have an impact on performance.
The simplest way to find and remove these files is to perform a search on your hard drive for any file called "*.tmp" (without the quotes). The asterisk (*) is a wild card character, which tells the computer to insert anything in that space. So, you are basically telling your computer to find any file that ends with ".tmp".
Once you have a list of these files, you can simply select them all (CTRL + A) and hit DELETE. Your computer may warn you that you cannot delete some of the files because they are in use. That is ok. Leave those files and delete the rest.
This may seem obvious to many, but some people do not realize that when you delete a file, it is not actually deleted - it is moved to the "Recycle Bin". The purpose of this feature is to allow retrieval of an accidentally-deleted file. This recycle bin does have a configurable maximum size, and will permanently delete the oldest files once this size is reached. However, you can empty the recycle bin yourself at any time to delete all of the files inside it and free more space on your hard drive. You should certainly do so before running Scandisk and Disk Defragmenter.
Scandisk is a utility that checks your physical hard drive for errors, and marks portions of the drive that may have problems so that they are not used. This can save data loss, and improve performance on your computer because it will not try to write data to bad portions of the disk.
Scandisk can be found in Windows by going to Start > Programs > Accessories > System Tools
When your computer writes files to its disk, it writes them in whatever space it can find. If a file is too big for the space, it will break up the file and put it in multiple spaces. Over a period of time, after creating files, deleting files, and creating more files, your hard drive becomes very "fragmented" - meaning there are "fragments" of files spread all over the disk in no logical order. Every time your computer needs to access one of these files, it has to search all over the drive to find all the pieces and assemble the file for use.
Defragmenting your hard drive can be one of the most effective ways of restoring your computer's performance. The Disk Defragmenter is included in all versions of Windows, and can be found by going to Start > Programs > Accessories > System Tools.
Note that in some versions of Windows, any process that changes the contents of the disk will cause the defragmentation process to restart. For this reason, it is highly recommended that you close all programs and even disable your screen saver before running the Disk Defragmenter. To speed up defragmentation, you should also remove unnecessary files and run the Scandisk utility first.
Many versions of Windows also include a disk cleanup wizard, which can delete temporary files, empty the recycle bin, and run Scandisk and Disk Defragmenter all in sequence.
If you are running a version of Windows (especially versions older than XP), and you leave your computer on all the time, you will likely notice performance problems after a couple of weeks. It's a good idea to restart your computer at least once a week, or better yet, shut it down when you are not using it. Sure, it takes a little while to start up, but most desktop computers are not designed to run 24 hours a day, and shutting it down at night or when you are away from home will extend the life of some of the mechanical parts inside the computer.
Shutting down your computer us also the only way to absolutely secure your computer against viruses and hackers. Your computer can't be taken over if it's not running.