I have lousy power - doesn't go out that often, but subject to fluctuations - and two UPSs on 24/7 for two different systems, as well as a Tripp Lite voltage conditioner for laser printer and some peripherals. A Google search for AVR (Automatic Voltage Regulator) or voltage conditioner should come up with plenty of options.
The less expensive UPS boxes are standby and kick in when the power goes below a threshold, but don't do anything to condition the power quality and just pass voltage variations through to the devices plugged into them. That's not usually a problem for modern PC power supplies, but it can be for some devices.
In my case, one UPS is an APC 650VA box and the other a Best Power line-interactive UPS. They both have worked well for about 15 years, although the batteries need replacement every 5 years or so. For dirty power the Best unit is better because it puts out a clean constant voltage and also provides diagnostics on the input line quality. Best Power was bought by Eaton a few years ago and incorporated into the Eaton Powerware line, which is available in localized versions in many countries.