IMAC screen goes black unexpectedly
Your Imac screen suddenly goes black on it's own. What to do?
My 27" Imac began to unexpectedly go to sleep mode all by itself, often right in the middle of typing a sentence of clicking on a program function. I would eventually get the screen to come back when the Imac "woke back up" but as this issue began to repeat more frequently, I had to find a solution.
Solutions that worked for me
 Change the ENERGY SAVER settings
When the screen began blacking out on me unexpectedly, but I realized I could get it to return by "waking up" the machine by waiting long enough, I surmised the problem was that the "Energy Saver" mode in the System Preference had gone haywire. My setting was originally to put the machine to sleep after 15 minutes of non-use. When the unexpected black outs repeated, though, waiting 15 minutes to "wake up" the machine was eating up large amounts of time, so I set the "Energy Saver" mode to 3 minutes. This was a temporary help as it allowed me to get my screen back sooner by having only a 3 minute sleep mode to sit through before waking the machine up with a mouse or keyboard tap. This was only a temporary help, though, because the "blackouts" began to happen more frequently and I had to find a "real" solution.
 Heat and cooling
I began wondering if the issue might be related to heat, since my office is in a building which faces a very direct shot from the sun, and the room can get well above normal temps during peak summer months, which was when my problem first cropped up (ever hold your hand above the top vents above your IMAC screen? It can be quite hot). I got a small Vornado fan and set it up to blow along the bottom of the screen of my IMAC, thinking the air circulation might help the bottom air vents beneath the screen to receive cooling air.
This seemed to help, because the black-outs stopped. But, a couple of weeks later the problem returned.
(A helpful tool for knowing the temps inside my Imac is the Tunebelly Temperature Gauge app which reports the temp numbers right into the dashboard strip at the top of the screen, right hand side.)
 Boot in Safe Mode
Safe mode runs a number of checks on the system and makes corrections as it finds them. This might fix the black out problem for you. To boot in "safe Mode" in OSX:
- Turn on your iMAC
- Press and hold down the SHIFT key assoon as you hear the startup sound
- Continue holding key until Apple logo appears on screen
Reboot your machine to return to your usual system operation
 ZAP the PRAM
"Zapping the PRAM" has been the all purpose shock therapy for Apple McIntoshes for decades. What this does is delete a series of settings that are kept in "PRAM" (Parameter RAM) which include customizations a user has made, for example mouse movement speed, volume on speakers, etc. By "zapping" the PRAM settings, all of these various settings are wiped clean, and if one of them is the source of the sleep mode kicking in unexpectedly, then your screen black out issue will be solved. (You will have to redo your various custom settings again, though.)
How to "Zap the PRAM"
- Shut down your Mac
- Reboot while simultaneously holding down the Command (Apple), Option, P, and R keys on your keyboard
- Keep holding down these keys while the computer restarts, you will see the start up screen for a moment and then it will reboot again. What you want to hear is the "bong" noise at startup FOUR TIMES, then release the keys.
 Too many apps open + RAM issue
My 27" Imac came with 4GB of RAM. I upgraded this to 12GB, and then later, upgraded that to 24GB RAM. It was not long after that the sudden screen blackouts began. This is quite circumstantial, and I continue to attribute the problem to the points I've raised already (PRAM, Heat), but I have noticed that when the screen blackouts initiate again after weeks of no problems, it will happen when I have a dozen ram-hungry apps on with many files open (Adobe Photoshop, Indesign, Illustrator, BBedit, Dreamweaver, Chrome Browser with 20 - 30 pages going, Fetch, Microsoft Word and Excel, plus more...) Another aspect is a heavily cluttered desktop with 60-100 files littered onto my screen. Since I was still getting blackouts, I considered these factors of "RAM and file overload" but couldn't confirm they played a genuine part in the problem. But I can state this: when the blackouts happen, and I then tidy up my desktop icons spilled across the screen (which makes them video ram hogs) and cut back on the number of programs and files I have open, the issue ceased.
 A band-aid solution: Resolution
I switched my screen resolution from 2560x1440 to 1920x1080 and the blackouts stopped. This was a less comfortable viewing resolution so I continued to work on the problem, but it has been a good temporary help.
 A band-aid solution: a second monitor
Having my Imac screen suddenly go to sleep in the middle of an urgent project is cause not just for the panic-stricken thought of "has the screen died for good?" but also "but I've got to get this work out the door immediately!"
In a way this is similar to a different annoying issue that pops up periodically: I'm working at top speed to finish an emergency project, and the wireless blue tooth mouse suddenly disconnects on its own. After struggling to get a stubborn mouse to reconnect, I came up with the solution of always having an Apple trackpad on. I prefer the mouse, but I can go to the trackpad instantly when the mouse disconnects (weak batteries or some other issue with the blue tooth connection) and either keep right on working or use it to quickly access the system preferences "mouse" tool to reconnect the recalcitrant mouse.
Likewise, with the Imac suddenly going to black, I realized I could just attach a second monitor and keep going (to make this easier I change the display settings to "mirror" so that each monitor will show the same thing). This isn't a real solution but only a band-aid, but when you're in the midst of completing work that other people are waiting on, a suddenly blackened screen doesn't make the deadlines go away. I use an old 23" Apple Cinema Monitor with a DVI connection, and using a Thunderbolt adapter, I can plug it into the 27" Imac on the fly. I also have a Yiynova drawing monitor that I can attach using a VGA-to-thunderbolt adapter and use it in a pinch.
 Does anything work permanently?
Each time I think I've got the problem beat, a month or two later it appears again. My worst experience, early on, was having the screen black out right after booting, which made accessing the Mac and working on the issue very difficult (this is how I started using a second monitor). But either by zapping the PRAM (#3 above) or by dealing with heat and power usage (#2 and #4 above) I've been able to make the problem go away for weeks or months at a time.
 Taking a look at your system log
A small program called "console" (find this inside a folder titled "Utilities" which is inside the "Applications" folder) lists the activities of your programs and system functions and can give you a good look at what was happening when your screen blacked out. This is a more technical side of investigation but can be important information if you are going to get deeper into finding a solution or will soon be needing to consult a professional repair facility. When your screen blacks out, note the exact time, get your screen back and then look in the console log at that time period for what the log registered.
 Other possible solutions
If you are looking at this page but are using an older Mac, you may need to deal with resetting the PMU - on how to do this, take a look at this page here at Macuserguide
A different key combination solution (which I have not tried but heard about) is pressing SHIFT + CONTROL + OPTION + POWER BUTTON at the same time for a couple of seconds. After this, press only the power button to turn the Mac back on.
Another solution I have not personally used is to reset the System Management Controller (SMC). This manages a host of functions, but one is thermal management. For full instructions how to do this for desktops and laptops made by Apple, go to the page here: https://support.apple.com/en-us/HT201295#t2