First thing you need to know: Never, and I do mean NEVER, listen to any computer related advise given to you by the cookie suggestion person ever again. They are so absolutely full of it, I would have a difficult time selecting an area to begin if I were going to go into why.
While it's difficult to say for certain this isn't a software issue with so few details, I'd feel pretty comfortable in a bet on the HDD going out on you.
So here's a couple of quick tests you can do. They aren't definitive, but will either point in the same general direction or not. Open some kind of word processor. Can be TextEdit if you don't have anything else. Go copy and paste a bunch of material off of some website, then save it. If, when you go to save it seems to take an unusually long time for the save dialog box to pop up, and then even the act of saving seems to take a good while, that points at the HDD. Still not definitive, but enough that you should probably take it somewhere to get it looked at.
It might also help to know what model iMac you have and the OS you're trying to run on it. If you have an iMac model that just barely made the cut for Lion, for example, and that's what you're running, then you can probably expect rather poor performance.
Tuesday, March 6, 12
Hope I can get some help. I have an iMac and I'm having a really problem working with this machine. I think that a turtle can out -perform this machine, it run's like a slob, that weal is constantly rolling when ever to click on anything. Someone told me that if I delete all my cookies it would run much better. I'm willing to try anything at this time, if this is true let me know how I would go about this process...
Thank you in advance...
John

Chowhound
Comic Vine
GameFAQs
GameSpot
Giant Bomb
TechRepublic