Anyone with a system that is used for anything more than a few emails a week should be protected against power problems (surges and sudden outages).
This can be easily done by purchasing an UPS (Uninterruptible Power Supply), a super-power-strip that has a battery. Depending on how much power your computer draws, it can be pretty small to almost car-battery large.
A UPS protects against both surges and outages. A mid-quality or better also can be set so that it keeps your system running until it's battery gets low, and then will command your system to do an 'orderly' shutdown, thus protecting any work-in-progress. (Look for a feature called something similar to "safe system shutdown").
Keep in mind these have at their core a battery just like your cars, so they are HEAVY! Pay attention to shipping terms. The one above has free shipping.
Also, make sure what you get has it's actual battery can be replaced when it wears out in 3-6 years or so. You'll save about half the price of full replacement.
For a typical home system, it would cost something like $60:
https://www.amazon.com/APC-Back-UPS-.../dp/B01FWAZEIU
On a personal note, I strongly recommend UPS's made by the company APC. I've had two systems hit by lightning (neighbor on left, then a year later the neighbor on the right). Both times APC was surprisingly helpful and super-fast on meeting their replacement warranty.