There's little solace in the fact that many people have had this same experience. I've heard horror stories and have been called into doing emergency tech support for countless friends, acquaintances, neighbours, distant relatives and even strangers, who took their hardware and software for granted, never imagining their data could be lost. One was a photographer who had accidentally erased a CF card full of a client's event photos. One was a friend's mother who had given her iPad in for repairs, not realising it would come back wiped clean.
Then there are situations in which you know you can't do anything after the fact. One friend's bag got stolen in a crowded train; he lost his laptop and the portable hard drive with all his backups on it. Another pulled out an old spindle of DVDs only to see that they had physically deteriorated.
Everyone makes mistakes. Disasters do happen. We just need to plan for them. Some people make backups only as a safeguard against accidental deletion, or only of documents they need to refer to older versions of. The friend whose bag was stolen was safe from one type of disaster, but not many others. Many people make copies of their data manually, at irregular intervals, but don't choose the right medium or location. Many back up the photos on their PCs but not the ones on their phones. Many lose track of what is where, or leave it to someone else to manage. Many simply don't bother.
People also assume data can be recovered - very often it can't, or it's incredibly expensive and time consuming to do so. It used to be easy to pop a hard drive out of a dead computer (assuming the drive itself was fine), but many of today's laptops and tablets don't offer us that layer of safety. Your data and the drive it's on might both be fine, but there might be no way to get it off a dead device.
I've come to realise a couple of things. First and foremost: one copy is not a backup. You need multiple backups, preferably created and updated automatically, and they need to be stored on different media and in different places. Second: it's going to take at least some time and at least some money. There's no easy way around it; this is a fact of modern digital life.
Here's the ideal strategy. First, you have to know exactly what you have, where it all is, and how much of it is irreplaceable. Your most important files can be divided into two categories: those that are updated at intervals, such as financial statements, and those that aren't, such as scans of important old documents. This will help you keep track of what you need to do and simplify your work. No matter which storage medium you choose, one copy should be in a fire-proof safe, and another (maybe less frequently updated) should be stored offsite. You can decide whether or not to use online services to store copies of these, depending on the level of security you need.
Following that, you need to identify all the files you have created yourself, which can never be replaced if lost. That includes everything you do for work and for creative hobbies, all your digital photos and videos, email archives, game saves, software customisations, Web bookmarks, etc. Lots of programs now save these things to their own online services so that you can move between devices easily - remember to sign in if you choose to use them, and remember the passwords! Online services that let you specify folders to monitor work best for such files, but a complete dump to an external hard drive once in a while can't hurt.
You can always re-download music, movies, games and TV shows so those don't need to be backed up as diligently. Services such as iTunes and Steam show all your purchases so you can track them, but you need at least a list of files you've obtained ad-hoc over the years.
As far as the backup medium is concerned, you have many choices. Optical media is typically short-lived and you might not be able to retrieve data in a pinch, so that's becoming less and less sensible. Hard drives are much more reliable but should never be your sole backup medium - and you need to treat them with care - never eject them unless it's safe to, and store them safely as well. Network-attached drives and private servers should have clean, reliable power. Solid-state drives could be expensive, and certain models have been shown to deteriorate when stored in less-than-ideal conditions.
Web services are increasingly becoming the best and most logical backup destinations. You have loads of options. As mentioned, lots of software now comes with an online component that backs up at least your settings if not your work. There are those with specific purposes such as Flickr for photos, which is really easy to use and offers loads of space. Some are specific to devices or companies, such as iCloud. There are services more attuned to syncing, including Dropbox and OneDrive. Then there are dedicated bulk backup services, of which Crashplan and Backblaze are the best known.
You might be able to get by with the free tiers of some of these services, but they're all really worth the cost of a decent subscription. Many offer unlimited space for a small fee, which will come to less than the cost of a few hard drives in the long run. The best part is you can back up devices of all kinds and always have all your data available to you. There's no worry about physical drive failure, because data is distributed and duplicated at the service's backend, and their hardware is a lot more robust than ours. Finally, you're safe from local disasters.
Backing up data does take time and effort, but it's like an insurance policy that you resent paying for until you need it. With the variety and effectiveness of services available today, no one has any excuse not to back their stuff up. You should never have to lose a precious memory or hours of hard work. Make a plan. You know you need to. One day in the near or distant future, you will either be sobbing that you didn't, or thanking your lucky stars that you did.