A lot of money is spent in data centers and offices to prevent lightning from getting into electronics. Lighning tends to be an afterthought at most people’s homes, even though lightning causes major damage to home electronics.
My neighbor had to replace every electronic component in his home a few years ago, including his garage door opener, doorbell, tv’s, dishwasher, and of course computers. I was lucky in that the same strike only took out my battery backup / surge protector, which had clearly done its job. My new house has a whole house lightning arrestor at the main on the outside of the house. These are generally available from your power company for a couple hundred dollars or for a few dollars a month. They aren’t foolproof as strikes can still get in through your cable line or phone line.
Best practice is still to unplug anything you don’t want zapped when there is a storm close by, but given that unplugging is not always practical, suppression equipment is a good and inexpensive insurance policy.
Duke Energy in Indiana offers full home surge protection here.