How to protect machine in unstable power condition?

How to protect machine in unstable power condition?