Your Mac is designed to assign access privileges, or permissions, to folders, documents, and apps automatically. When issues occur with these permissions, your can repair them with the built-in Disk Utility. To run permissions repair, go to Applications -> Utilities -> Disk Utility. In the left column, select your startup disk. Then click the First Aid tab and finally click Repair Disk Permissions.
Note: This feature has been removed from Disk Utility in El Capitan (OS X 10.11) and above.
Clean Web Browser Caches
Web browsers will save EVERYTHING you do, and these files can build up and significantly slow down your Mac. Many issues with web browsers can be resolved simply by cleaning the cache (and, if necessary, deleting the cookies). In Safari, click Safari from the top toolbar and select Reset Safari. Then select the options you would like to clear. In Firefox, cache management is located in the Tools section under Clear Recent History. Options to delete include Browsing & Download History, Cookies, and Cache.
Third-Party Software for Additional Maintenance
There are additional items that can and need to be cleaned and maintained on your Mac, but to access them requires an intimate knowledge of Terminal (which is not for the faint-at-heart). To simplify these tasks, there is an excellent piece of software called OnyX. OnyX is considered a multi-function utility and includes options to verify the Startup Disk, run miscellaneous systems maintenance, and clean caches. It's a pretty powerful program, so please read all available documentation before running any of the routines.
To Defrag, or Not to Defrag?
Mac defragmentation has been a topic of debate for years. By design, OS X automatically defragments files under 20MB, but it won't defragment your entire hard drive. What if you deal with a lot of files that are larger than 20MB? For those situations, there is no built-in solution. A fragmented Mac hard drive can cause system slowdown due to the lack of contiguous space needed for virtual memory. So what are the options? Unfortunately, there is no free software available for disk defragmentation on the Mac. Fortunately, there are a couple of good paid ones. The first is Drive Genius. The app is actually a multi-function utility and includes options to optimize your drive, analyze/repair/rebuild volumes, and defragment the drive. The second, and arguably better, app is iDefrag. This is basically a one-trick pony, but it manages the trick very well.
Note: Defragging a solid-state drive (SSD) is NOT recommended. Running a defrag routine on a SSD can cause extra wear on your drive. SSDs have their own built-in utility for keeping your drive in check (calling TRIM) and that's usually all that's needed.