When there are elections and both sides are bad and will hurt Muslims, should Muslims avoid voting to not cause any harm?
Praise be to Allah, the Lord of the World; and may His blessings and peace be upon our Prophet Muhammad and upon all his Family and Companions.
If your participation in the elections doesn't achieve any benefit and advantage for the Muslims of that country and it will not prevent the harm from them, in that case you (Muslims) should boycott the elections. Also, if the election candidates are in the same level of harming the Muslims, you shouldn't vote for anyone of them.
But, if the one of them is much worse than other election candidate then you should vote for the one who is less harmful for the Muslim community by way of preventing greater harm with the election of one of these candidates.
Allah knows best.
You can search for fatwa through many choices