The most important new feature in iOS 5 (the massive new software update for the iPhone, iPad, and iPod Touch) and iCloud (Apple’s cloud-based sharing service) is also one you’re most likely to forget—well, until you really need it, anyway.

Once configured properly, iCloud Backup will automatically make copies of all the settings, accounts, messages, photos, and applications settings on your iDevice and stores them on Apple’s servers. There they’ll wait patiently, in case something bad ever befalls your handset.

The beauty of iCloud Backup lies in how little work is involved on our part.

You just plug your iPhone, iPad, or iPod Touch into a power outlet, lock its screen, and tuck it in for the night—just like you usually do—and your device will wirelessly transmit its backup files to your iCloud account in the sky, as long as there’s an available Wi-Fi connection.

It’s a great feature for anyone who rarely bothered to dig out their sync cables to manually back up their handsets with iTunes—assuming iCloud Backup works as advertised, that is.

How to restore your iPhone (or iPad) with an iCloud backup

Make sure you’ve got iCloud Backup switched on in the iOS settings menu.

As someone who’s seen his fair share of computers and phones fail on him over the years, I wanted to put iCloud Backup to the test before trusting it with my precious data. So I took my test iPhone 3GS, updated it to iOS 5 (required for using iCloud), and launched into the iCloud restortion process, all in the name of science.

Update [3/16/12]: Check out my new, step-by-step guide on how to restore an iCloud backup of your old iPad onto your new iPad.

The first step, of course, is making sure you have an iCloud backup in the first place. Assuming you have iOS 5 installed on your device and that you’ve signed up for a free iCloud account (if not, you can grab one right here), just tap Settings, iCloud, then scroll down and confirm that “iCloud Backup” is set to “On.”

Look just beneath the “Back Up Now” button to see the last time your iPhone (or iPad, or iPod Touch) backed itself up. If it’s been a few days, or never, you can tap “Back Up Now” to create a fresh backup.

I went ahead and followed those steps for my test iPhone, then took a deep breath (well, it wasn’t that deep, given that there’s nothing all that important on my test phone) and wiped my iPhone 3GS’s memory clean.

How to restore your iPhone (or iPad) with an iCloud backup

Choose “Restore from iCloud Backup” to begin the restoration process.

A few minutes later, I was staring at a gray screen that read “iPhone”—exactly what you’d see if you’d just taken a brand-new iPhone out of its box.

After pick a language (English) for my “new” iPhone and agreeing to a lengthy legal agreement, I was presented with a choice: I could set up my iPhone as a brand-new handset, restore a backup from iTunes, or—here we go—restore an iCloud backup.

I chose the iCloud option, signed in to my account, and a few seconds later my iPhone displayed the online backup that it had found: the very one I’d created only a few minutes ago.

I selected the file, and pretty soon a screen popped up that read “Restoring from backup,” complete with a progress bar and an estimate of how much time I had left to wait. Since my test iPhone doesn’t have many messages or photos on it, the process only took a few minutes; your mileage may vary, however. (You should also make sure your iPhone’s power cable is plugged in during a lengthy restoration.)

How to restore your iPhone (or iPad) with an iCloud backup

There’s the backup for my iPhone, right where it’s supposed to be.

My iPhone restarted itself, and pretty soon, there it was—my old iPhone again, just as I’d left it before, restored wirelessly through iCloud.

Well…almost. A final step involves re-downloading all your apps from the App Store, a process that the iPhone handled automatically.

It also tried to re-download my music, but informed me that the tunes on my phone hadn’t come from the iTunes Store (true), so I’d have to transfer them manually from wherever I’d originally synced them. Fair enough, and easily done. (A $25-a-year feature called iTunes Match will let you sync and store all your music in iCloud, not just songs purchased on iTunes.)

So yes—iCloud Backup works, and it works well.

Again, though, remember that iCloud Backup won’t do its thing on its own. You must sign up for iCloud (it’s free, as long as you keep your online storage under 5 GB) and turn on iCloud Backup in the Settings menu.

It’ll take a few minutes to set up, but believe me—if you ever leave your iPhone in cab or drop your iPad in a swimming pool, you’ll be happy you went to the (minor) trouble.

Have questions about restoring your iPhone, iPad, or iPod Touch with iCloud Backup? Post ’em in the comments below.