A Catholic would be guilty of formal cooperation in evil, and so unworthy to present himself for holy Communion, if he were to deliberately vote for a candidate precisely because of the candidate's permissive stand on abortion and/or euthanasia. When a Catholic does not share a candidate's stand in favor of abortion and/or euthanasia, but votes for that candidate for other reasons, it is considered remote material cooperation, which can be permitted in the presence of proportionate reasons.
265 pope of the Catholic Church from 2005 to 2013 (1927–2022)
Pope Benedict XVI (born Joseph Aloisius Ratzinger; 16 April 1927 – 1 January 2023) was a prelate of the Catholic Church who served as the head of the Church and the sovereign of the Vatican City State from 19 April 2005 until his resignation on 28 February 2013. Benedict's election as pope occurred in the 2005 papal conclave that followed the death of Pope John Paul II on 2 April 2005. Benedict chose to be known by the title "pope emeritus" upon his resignation.
From: Wikiquote (CC BY-SA 4.0)
From Wikidata (CC0)
To have Christian hope means to know about evil and yet to go to meet the future with confidence. The core of faith rests upon accepting being loved by God, and therefore to believe is to say Yes, not only to him, but to creation, to creatures, above all, to men, to try to see the image of God in each person and thereby to become a lover. That's not easy, but the basic Yes, the conviction that God has created men, that he stands behind them, that they aren't simply negative, gives love a reference point that enables it to ground hope on the basis of faith.