iMac hard drive failed completely, My 2011 vintage iMac hard drive failed completely and local Apple techs say they cannot retrieve any data. I recall that I had files automatically being backed up to iCloud but do not know how to retrieve them from there.
The easiest way to check if you have anything in iCloud is to log into icloud.com. Here you can see the contents of iCloud Drive as well as what photos have been loaded into the Photo Stream or Photo Library. You will also see notes, contacts, etc if you use those apps.

However, 'backup' may be over stating matters: Time Machine is the Mac's built in backup solution, however it won't backup to iCloud or iCloud drive. 

You of course can store files on iCloud drive, and often your Documents and Desktop folders are configured to be in iCloud drive by default.  You may also have configured Photos to backup to iCloud Photo Library, though this is reasonably rarer than doing it for the iPhone. If you pay for iCloud, you likely are using it for these items. If you do not pay for iCloud, I suspect you have very little (5GB only) stored in iCloud.

Once you get MacOS back on your Mac, you can log in with iCloud and all the content in iCloud will sync back to your restored Mac. 

Good luck