Avoid installing third party so called Mac cleaning utilities such as MacKeeper and Clean My Mac. They often do more harm than good.
Not enough free space on the startup disk can slow the system down.
Right or control click the MacintoshHD icon. Click Get Info. In the Get Info window you will see Capacity and Available. Make sure there's at least 15% available disk spac.e
Run Disk Utility. The startup disk may need repairing > Using Disk Utility to verify or repair disks
Whatever you do, resist the temptation to install any third party utility claiming to "speed up", "clean up", "optimize", or otherwise perform some magical incantation that will cure whatever is ailing your Mac. Without exception, they will do the opposite. If you already did that, you found the problem. Un-do it. The fact that your iMac was "previously owned" makes this a significant possibility.
Barring hardware failures and software that you installed, your Mac should run as well as it did the day it was built.
Some of these Apple guides may help:
- General Mac maintenance: Tips to keep your Mac in top form
- General purpose Mac troubleshooting guide: Isolating issues in Mac OS X
- Creating a temporary user to isolate user-specific problems: Isolating an issue by using another user account
- Memory limitations: Using Activity Monitor to read System Memory and determine how much RAM is being used
- Identifying resource hogs and other tips: Runaway applications can shorten battery runtime
- Starting the computer in "safe mode": Mac OS X: What is Safe Boot, Safe Mode?
- To identify potential hardware problems: Apple Hardware Test
Adding to Mr. Galt's list, see these:
Mac OS X speed FAQ,
Speeding up Macs,
Macintosh OS X Routine Maintenance,
Essential Mac Maintenance: Get set up,
Essential Mac Maintenance: Rev up your routines,
Maintaining OS X,
Five Mac maintenance myths
How to Speed up Macs, and
Myths of required versus not required maintenance for Mac OS X for information.