Like death and taxes, it's guaranteed that at some point in time you will experiance a hardware or software failure that will stop you accessing your files. In many cases this may be caused by a dead power supply or blown motherboard, but what if it's the physical drive where your data is stored? Hopefully you have previously implimented and stuck too a working backup strategy - so nothing is lost.
If you haven't got a working backup - then you can be in serious trouble. Unfortunately the skills and equipment required to reliably recover your precious files from either a hard drive or memory stick do not come cheaply - and worse still, much of the cheap or free 'recovery software' on the web can make matters worse.
The most important thing is not to panic and rush into trying to fix it yourself. Stop, turn off the unit, and think about what's at risk. Be aware that sometimes your data will in fact be lost for ever, think carefully about where you may have other copies of your important files, did you upload the photos to Facebook, did you email the document to work last week?
I have some very good commercial file recovery software which handles many file recovery tasks, but I have also partnered with Fields Data Recovery who offer full clean room services when drive dismanteling is required.