Impossible to answer with information provided.
Exactly which model of iMac are you running?
How much RAM does your iMac have?
How large is your system disk?
How much free space is on yoour system disk?
What version of OS X is it running?
run fewer applications at the same time
install more memory
uninstall applications you are not using
replace the harddisk with a SSD disc
Have a look here...
Retrieving data ...