Do not do good to the wicked, and evil will not come to you/ do no favour to the wicked
Do not help an evil person, and you will not suffer from evil. Doing good and helping an evil person strengthens him, and it is forbidden in the end to harm the one who helped him (from the source of the examples of Abel who had mercy on Cain and ended up being killed, or of a man who was attacked by a lion and was devoured by it).
("Rabbi Johanan said, 'Hevel was a hero from a place,' that there is no Talmud to say 'and he will stand' unless it is taught that it was given under him. Hevel said to Cain: We have heard in the world, 'Why do you go and say, 'Father?'? We were filled with compassion for him. He stood by him and killed him. From Taman, we are not from the word 'good,' you will not be able to wear clothes, and I will not put shame on you." (Translation: good) "Do not do evil, and no evil will come to you" - Parashah Bereshit Rava (Theodor-Albeck) Parashah Bereshit Parshah 22)
Translation
Expression (Hebrew)
טוֹב לְרַע אַל תַּעֲשֶׂה וְרָעָה לֹא תַּגִּיעַ אֵלֶיךָ
Definition (Hebrew)
אַל תְּסַיֵּיעַ לְאָדָם רַע וְכָךְ לֹא תִּסְבֹּל מֵהָרֹעַ. עֲשִׂיַּת טוֹבָה וְעֶזְרָה לְאָדָם רַע מְחַזֶּקֶת אוֹתוֹ וַעֲלוּלָה בַּסּוֹף לְהַזִּיק לְמִי שֶׁעָזַר לוֹ (בַּמָּקוֹר מוּבָאוֹת הַדֻּגְמָאוֹת שֶׁל הֶבֶל שֶׁרִחֵם עַל קַיִן וְסוֹפוֹ שֶׁנִּרְצַח, אוֹ עַל אָדָם שֶׁרִפֵּא אַרְיֵה וְנִטְרַף עַל יָדוֹ).
("אָמַר ר' יוֹחָנָן הֶבֶל הָיָה גִּבּוֹר מִקַּיִן, שֶׁאֵין תַּלְמוּד לוֹמַר 'וְיֶקֶם' אֶלָּא מְלַמֵּד שֶׁהָיָה תַּחְתָּיו נָתוּן, אָמַר לוֹ (הֶבֶל לְקַיִן): שָׁנִינוּ בָּעוֹלָם, מָה אַתְּ הוֹלֵךְ וְאוֹמֵר לְאַבָּא?, נִתְמַלֵּא עָלָיו רַחֲמִים. מִיָּד עָמַד עָלָיו וַהֲרָגוֹ, מִן תַּמָּן אִנּוּן אֶמ' טָב לְבִישׁ לֹא תְּעַבֵּד וּבִיְּשָׁה לֹא מָטִי לְךָ(תַּרְגּוּם: טוֹב לְרַע אַל תַּעֲשֶׂה וְרָעָה לֹא תַּגִּיעַ אֵלֶיךָ)"- בְּרֵאשִׁית רַבָּה (תֵּאוֹדוֹר-אַלְבֵּק) פָּרָשַׁת בְּרֵאשִׁית פָּרָשָׁה כב)