Effect vs Intention

I’m troubled that I don’t know which is more important: effect or intention. I used to think that intention is what counts. After all, “it’s the thought that counts” they say. But then I witnessed the brutal barbarism of socialism in Russia and China. It’s repulsive. Their defense is that they had good intentions. Well, the road to hell is paved with good intentions. So now I’m conflicted.
To add to the mix, I read this book: HPMOR. It made the case that they way to understand someone’s intentions is to look at their actions (and effects). It’s very easy to lie and have things work out in your favor. And if this happens over and over, it might not just be luck.
Now I just don’t know.