Messenger of Allah ﷺ said, "Help your brother whether he is an oppressor or an oppressed," A man said, "O Messenger of Allah ﷺ! I will help him if he is oppressed, but if he is an oppressor, how shall I help him?" The Prophet ﷺ said, "By preventing him from oppressing (others), for that is how to help him."
قَالَ رَسُولُ اللَّهِ ﷺ انْصُرْ أَخَاكَ ظَالِمًا أَوْ مَظْلُومًا فَقَالَ رَجُلٌ يَا رَسُولَ اللَّهِ أَنْصُرُهُ إِذَا كَانَ مَظْلُومًا أَفَرَأَيْتَ إِذَا كَانَ ظَالِمًا كَيْفَ أَنْصُرُهُ قَالَ تَحْجُزُهُ أَوْ تَمْنَعُهُ مِنَ الظُّلْمِ فَإِنَّ ذَلِكَ نَصْرُهُ