My advice? Stop assuming things are good. Lose the sense of shock at evil existing. Assume it's all evil and there is no aspect of it that is not corrupted in some fashion by depravity. Nothing is new. Nothing is pure.
We should not despair that the world is still evil. It should not surprise us -- any honest reading of history should tell us this. Evil does not shock or surprise me. Instead, I'm surprised and delighted that -- despite its depravity -- any good exists in the world at all.
The world is continually evil all the time, yet I take hope and work to cultivate its redemption. Assume it's all evil, yet seek for pockets of good. Control the controllables and don't lose your head over the rest.
I don't think we can prevent evil from occurring. If all good people walked away from technology today, corporate asshats and totalitarian governments would still continue forward. We can't stop that.
If we want to have any hope of a good ending, we need upright, moral men and women at the forefront of technology working to do good in spite of bad actors existing.
I place a lot of hope in the open-source movement -- it feels like one of the only ways for good to survive and continue to grow.
If you want more encouragement along these lines, the classic article "The world is awful. The world is better. The world can be much better." [0] may be helpful.
* [0] https://ourworldindata.org/much-better-awful-can-be-better