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.
Good Luck!
🙂