OSX 10.11.5 iMac turns on fine but loading bar gets to just over 50% and then a horizontal bar across the screen shows, then the screen goes black then to white. It stays at white then iMac turns itself off and restarts. This happens every time I try turning it on, booting into the backup, booting into recovery mode, and even rebooting from single user mode: the iMac will still be showing the terminal doing its thing the the line appears and mac goes to a white screen then reboots. Booting in safe mode and resetting PRAM and SMC have done nothing. Any ideas? or tips on how to backup any data and reinstall OSX from single user mode?
Have you recently changed anything in the hardware?
I had this happen once trying to swap drives between two Macbook Pros. They were different hardware versions (a couple of years apart), and the hard drive from the older Macbook did exactly this when trying to boot in the newer Macbook - the old version of the O/S didn't understand the newer hardware, and would get to a certain point, and then reboot.
After I put the drive back in the original (older) Macbook, I upgraded to the latest version of OS X, and was then able to put the drive into the newer Macbook without issue.
This doesn't sound like what you're doing (you didn't mentioned swapping any hardware), it does sound like you're having an issue with hardware that can't be properly started. So I'd be assuming hardware issue at this point, which hopefully someone can assist you in how to diagnose that.
If you arent able to get into MacOS recovery mode, try internet recovery mode (Command (⌘) + Option (⌥) + R) and see if you are able to run it off of the internet.
If this doesnt work for you, then you need to get the Mac inspected at a genius bar.
It's likely something wrong with the motherboard.