You should never, EVER let a hard drive get this full to the end...EVER!
Aassuming you can get your iMac booted, The only real and safe way to do this is to do it manually looking through each folder individually.
Many third party utilities claim to clean out a hard drive of various detritus, but some times will delete data that it shouldn't and delete any other important data that it shouldn't have.
The only "safe" way to accomplish what you need to accomplish is to do this manually.
Stay away from the OS X system folder!!!!!
Hard drive getting full?
You need to reclaim, at the very least, 15 GBs or more free data space on the hard drive.
At some point when you have recovered enough drive space, You can download an app called OmniDiskSweeper.
This app will allow you to see where files maybe able to be delete are located.
If your Mac is running a fairly recent version of OS X, here are some general guidelines.
Follow some of my tips for cleaning out, deleting and archiving data from your Mac's internal hard drive.
First thing, if you can get your iMac booted, Have you emptied your iMac's Trash icon in the OS X Dock?
If you use iPhoto, iPhoto has its own trash that needs to be emptied, also.
If you store images in other locations other than iPhoto, then you will have to weed through these to determine what are duplicates and what isn't
If you use Apple Mail app, Apple Mail also has its own trash area that needs to be emptied, too!
Other things you can do to gain space.
Delete any old or no longer needed emails and/or archive to disc, flash drives or external hard drive, older emails you want to save.
Look through your Documents folder and delete any type of old useless type files like "Read Me" type files.
Again, archive to disc, flash drives, ext. hard drives or delete any old documents you no longer use or immediately need.
Look in your Applications folder, if you have applications you haven't used in a long time, if the app doesn't have a dedicated uninstaller, then you can simply drag it into the OS X Trash icon. IF the application has an uninstaller app, then use it to completely delete the app from your Mac.
Download an app called OnyX for your version of OS X.
When you install and launch it, let it do its initial automatic tests, then go to the cleaning and maintenance tabs and run the maintenance tabs that let OnyX clean out all web browser cache files, web browser histories, system cache files, delete old error log files.
Typically, iTunes and iPhoto libraries are the biggest users of HD space.
move these files/data off of your internal drive to the external hard drive and deleted off of the internal hard drive.
If you have any other large folders of personal data or projects, these should be archived or moved, also, to the optical discs, flash drives or external hard drive and then either archived to disc and/or deleted off your internal hard drive.
If you can't get your iMac to boot normally to clear out the hard drive, the next step would be to go out and purchase an external hard drive to install and boot OS X from as well as use as a backup hard drive.
Without knowing the model of your iMac, purchase a drive with a fast connection protocol like USB 3, ThunderBolt or FireWire 800/400. My Preference is to stay away from strictly USB 2.0 external drives if you plan to boot from an external drive more regularly and run for awhile from an external drive.
Plus, the faster protocol interface makes transferring data faster.
I've created a User Tip explaining how to install OS X on a external drive and boot from it.
This will allow you to target the internal drive for large file transfer and deletion to free up drive space for the virtual memory file, remmeber you need to Empty Trash to reclaim the disk space as the Trash is simply another folder.
Great instructions and I have tried everything but my problem is that when I get to disk utilities most of the options are greyed out and I cannot erase from there -- not an option. Is there a way to go the to Terminal (through DU) and type in command to delete some files -- a lot of video files on my son's computer that I think are causing there not to be enough memory. Do you have simple instructions for what to type at Terminal in order to delete those files so that I can free up some space and actually reinstall os X? thanks!
To read the OS X partition on Mac you need HFS+ file system drivers.
Let me know what version of Mac your running and I'll see if I can get you the appropriate boot camp HFS+ driver. The other alternative is paid product like; http://software.bigbigsoft.com/data-recovery-mac
If you don't want to create an external boot drive you can take it to a Genius Bar at an Apple store and without charging you they will boot if for you and help you clear enoug disk space so you can boot again.
Genius reservation http://www.apple.com/retail/geniusbar/ .