It's most peoples worst computing nightmare. You wake up in the morning, flip on the computer, and it doesn't boot. Sometimes the problem rears its ugly head as a horrific clacking noise. Other times it simply gives a read error.
At this point, most people panic. The first thing you wonder is whether or not the data is recoverable. There is no universal answer to this. In some cases, a simple scan with some data recovery software is all that it takes to retrieve the contents of the drive. In other cases, if you want it badly enough, it will take thousands of dollars and a shipment of the drive to a clean lab where they will pull the platters inside of the drive and access them that way.
Now you're probably wondering if there's a way to prevent this from happening. Well, you're in luck. Getting a UPS (Uninterruptible Power Supply) is the very best and most effective way to prevent your data from pulling a disappearing act.
While it is not fool-proof, having something that regulates the electricity flowing into your computer can reduce the risk of a drive failure by up to 70%. This figure goes up to around 90% if the computer is being used while in an electrical storm. (My computer repair business always gets a little boost after a thunderstorm, courtesy of the lightning wreaking havoc on people's hard drives.)
Don't just run out and get any UPS. You want to get an intelligent one. The "intelligent" UPS will regulate the power without having to hit the battery every time the voltage takes a dip which greatly improves battery longevity. They also include options to hook the power supply up to your computer via a serial or USB port so you can monitor what the power is doing. This also gives the option to allow for a soft shut-down if the power goes out and you are away from your desk.
You can get an Uninterruptible Power Supply at most computer stores. Best Buy carries a fairly wide selection of them.
As for brands, I've personally used APC with much success. Opti-UPS is another excellent brand. In fact, I have an Opti that is 6 years old and still works fine, although the batteries now have no life to them. (That's to be expected. Rechargeable batteries only last so long)
Now that you know of the importance of a UPS I would strongly encourage you to invest in one. It is far better to spend $100 now on some preventative maintenance than having to spend much more later on data recovery.