If you have only a Time Machine backup
Let's say you wisely supplemented your cloud-based syncing or backups with Time Machine (but have no other local backups). This means you can restore every single file on your disk, including OS X itself and all your applications, to their state at the last time Time Machine ran. You can do so even if you install a completely new, blank drive. In this case the smartest move is to start by restoring the Time Machine backup (see "How to restore data from Time Machine"), and then to use your cloud sync or backup software for any files that may have changed since your last Time Machine backup. (In all probability, there will be few if any of these.)
I should mention, however, that if you use Dolly Drive to store your Time Machine backups in the cloud, restoring your whole disk over the Internet may be impractical (and it will certainly be very time-consuming). Dolly Drive recommends, as I do, that you also have a bootable duplicate (or "clone") of your startup volume on a local hard disk, and that you restore that duplicate before downloading files from the cloud, as I'll cover in the next scenario.
If you have a bootable duplicate
If, in addition to cloud backups, you made a bootable duplicate of your entire disk, restoring that first will give you the fastest path, by far, to complete data recovery. Attach the disk containing your duplicate to your Mac, and then restart the machine while holding down the Option key. Select the duplicate and press Return to start your Mac from that disk. Then run whatever app you used to create the duplicate, such as Shirt Pocket Software's $28 SuperDuper or Bombich Software's $40 Carbon Copy Cloner, to reverse the process. Select your duplicate as the source and your new, empty internal disk as the destination.
Within a few hours, the restoration should be complete. Use the Startup Disk pane of System Preferences to set your startup volume to be your internal disk, and restart. Your Mac should now be exactly as it was the last time you updated your duplicate, which, if you take my advice, will be no less often than once a week.
Now, all that remains is to download any files you backed up to the cloud since that duplicate was last updated. For syncing services such as Dropbox, you don't have to do anything; the download just happens automatically in the background. For certain backup apps (notably CrashPlan), unfortunately there's no automated way to say "restore all files modified since date x." You may have to either manually select the files you want to restore or restore everything, which will involve overwriting many files with identical copies from the cloud. That will, however, eventually get your disk back to where it was.
This story, "Restore your data from the cloud" was originally published by Macworld.