Updated March 2017
Before I begin this tutorial, I cannot stress enough that if you have MacKeeper installed on your system you must uninstall it immediately and safely. To do this, please read my tutorial below to ensure you do it properly and you don't damage your Mac in the process. You could find after uninstalling MacKeeper your Mac is back to normal. Perform the following maintenance anyway, as it probably hasn't been done for a while, if at all. MacKeeper is malicious malware marketed as a Mac cleaning tool.
If you're a Windows user, follow this tutorial.
It's widely known and marketed that the Mac 'just works' and to tell you the truth, this is mostly correct. Apple designs and manufactures both the hardware and the software for their devices and it is this optimisation that ensures your device works great each and every time. However, this does not mean that maintenance, fixing and cleaning your Mac isn't necessary... Because it is. Most people forget about this and go about using their Macs for many years without giving their computer the attention it deserves. Then one day it decides to slow down, become sluggish and you feel the need to purchase a new Mac... Often resulting in a very painful back pocket.
The first thing you want to do is perform a backup. I recommend Time Machine. If it is already set up, great, click Backup Now. If you don't know how to do it, hook up an unused external hard drive, go to System Preferences > Time Machine, turn it on, then follow the prompts to set it up. Follow this tutorial on the Apple Support Site for in-depth instructions. Once your backup is complete, we'll begin cleaning your Mac.
Before we begin, close every program. Including those that are running in your menu bar. Once they are all closed, restart your Mac. If you have BackBlaze, CrashPlan or another online file backup service, you can't quit these so just leave it.
The steps in this tutorial are in order. So perform them as you read
Open Activity Monitor
Finder > Applications > Utilities
This app shows you every program and process that is currently active on your computer. It also tells you how much of the CPU its using as a percentage, how much RAM its taking up, disk space and lots of other things. What you'll want to do is click on CPU tab, and have a look at what programs or processes are taking up the most CPU usage. In my case it's DaVinci Resolve. 34.8% is a monstrous amount of CPU usage, however I'm currently using it and so it's not an issue. However if you saw something there using anything above 15% and you're not using it, then select it, and hit the X Stop Sign button in the top left of the window. That will close it down.
Clean Out Your Startup
System Preferences > Users & Groups (Accounts) > Login Items
Your Startup is what programs and/or processes that open or start running once you turn on your device. If you have cloud services like Dropbox, BackBlaze or Google Drive, you can leave these here. But anything in there that you don't need (most likely everything else) can be removed by selecting it and hitting the minus (-) button.
Uninstall Unneeded Apps
Uninstalling apps won't make your Mac perform any better, however it'll free up disk space and this will make Finder faster and less sluggish. To uninstall apps, use the uninstaller that came with it. You can find that in Applications in the app's folder. However, most apps don't come with an uninstaller so to uninstall those control-click (right-click) on the app icon and choose Show Package Contents. Then move the Contents folder and anything else you see to the trash. You can then also move the app icon to the trash then empty it. That's it, programo el gono.
This method of uninstalling doesn't always remove the files associated with the app. To fix this, you need to go in to system folders and manually delete them–this is a problem if you don't know what you're looking for. I'm currently testing a third-party program that helps with this, and I'll add that process and screenshots here when I feel it's suitable and safe to use. Join Our Facebook Group to keep updated.
In OS X 10.10 Yosemite and Older: Finder > Applications > Utilities
Disk Utility is the program you use to ensure the disks and drives in your Mac are performing as they should, and you use it to repair them when they misbehave. To do this click on Macintosh HD in the side panel. You'll notice that Verify Disk Permissions and Repair Disk Permissions are greyed out and you can't click them, that's fine, go ahead and click Repair Disk on the right. Your Mac will become sluggish during this step, so just be patient and wait for it to finish. Depending on the age of your Mac this could take a couple of minutes or sometimes up to 10 minutes or more. Once done, click on the sub-level Macintosh HD and do the same thing, only you'll notice on this one that Verify Disk Permissions and Repair Disk Permissions are available. You'll use these two. Click Verify Disk Permissions first; again, your Mac may be unresponsive. Once that's complete click Repair Disk Permissions.
In OS X 10.11 El Capitan and Newer: Finder > Applications > Utilities
If using OS X 10.11 El Capitan, the disk utility function has changed. Click the sub-level Macintosh HD drive from the side bar, then click the First Aid button up the top. This will automatically verify and repair permissions for you.
If you happen to get a message saying something like "Unable to repair Macintosh HD Use Disk Utility in Recovery Mode" simply quit all your programs and restart your computer. Once the screen is black, immediately hold down the command ⌘ key and the R key. This will start your Mac up in Recovery mode. Open Disk Utility and run the same procedure again. Once done restart your Mac normally.
PRAM/NVRAM Reset (Optional)
If you experience issues with screen resolution, speaker volume or startup disk selection, doing a PRAM or NVRAM reset will help those issues. Simply shut down your Mac and locate the Cmd (⌘), Option, P and R keys on the keyboard.
Turn on your Mac and when you hear the startup tone, hold down Cmd+Option+P+R and keep holding those keys down until the Mac restarts again, and release the keys when you hear the startup tone a second time. If you're using a desktop Mac (iMac, Mac Mini or Mac Pro), it's quite possible that the battery in the logic board needs to be replaced. The logic board battery keeps it running even when your Mac is shut down. This is so NVRAM settings are retained and don't reset each time you turn off your computer.
After doing this PRAM/NVRAM reset, you may need to reset your speaker, screen resolution and Time Zone information.
SMC Reset (Optional)
There are so many reasons why you may need to perform a System Management Controller (SMC) reset, so many in fact, that I'm going to link you to an Apple support article on this procedure instead of writing my own. You're welcome to contact me in regards to this procedure if you feel you need specialised assistance.
SMC Reset Apple Support Article: https://support.apple.com/en-au/HT201295
And Finally Update, Update, Update
Finder > Applications > App Store
It is utterly vital that you keep your Mac up to date. This ensures its security is updated, the apps are bug free and that your operating system is running the latest version. Open the Mac App Store, Finder > Applications > App Store. Click on Updates tab and allow it to load. Click Update All if there are any apps that need updating. When you do this, go off and have a beer, coffee, read the paper or whatever, this step could take a very, very long time depending on how many updates you need. Your computer my restart by itself in this process, that's fine, don't freak out. Make sure your computer is connected to the internet for this step.
You can have your Mac automatically update its software for you, so you don't have to do it. Simply enter System Preferences and click on the App Store icon. Ensure the following check boxes are enabled.
I've disabled Install OS X Updates as these restart your computer. And you don't want your computer randomly restarting on you. So in this case, it is good practise to check the App Store every three months for these system updates. Finally, once all these steps are complete restart your computer.
If after you've completed all these maintenance checks–you should do these at least once every two months–you find that your Mac is still somewhat slow and sluggish you may want to replace the RAM. This is a simple step, I recommend OWC's website for more information. Replacing the hard drive inside is also an option. I recommend replacing it with an SSD, these are hard drives that don't use any moving parts, and instead, use high performance, super fast microchips to store your data... And they are FAST! I don't recommend you do this yourself, however if you feel you could handle it, choose your Macbook Model here for a step-by-step tutorial and your iMac model here for a tutorial as well. Otherwise contact your nearest Apple Retail Store or Apple Authorised Service Provider and inquire about getting an upgrade... This could be pricey, but still a better investment than getting an all new computer. Of course, back up your computer using Time Machine before replacing your hard drive.