Anas bin Malik reported,

The Messenger of Allah ﷺ said, "Help your brother, whether he is the oppressor or the oppressed."The companions asked, "Messenger of Allah, we understand helping him when he is oppressed, but how do we help him when he is the oppressor?"He replied, "By restraining his hand."

Azami 13346

Sahih

عن أنس قال

قال رسول الله ﷺ: انصر أخاك ظالما أو مظلوما قالوا: يا رسول الله، هذا ننصره مظلوما فكيف ننصره ظالما؟ قال: تأخذ فوق يديه

الأعظمي 13346صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Tafsir of the great Quran
Chapter
Tafsir of Surah Hujurat
Section
His saying, "And if two factions among the believers fight, then make settlement between them. But if one of them oppresses the other, then fight against the one that oppresses until it returns to the ordinance of Allah. And if it returns, then make settlement between them in justice and act justly. Indeed, Allah loves those who act justly. The believers are but brothers, so make settlement between your brothers and fear Allah that you may receive mercy."
Numbering
Jami al-Kamil 13346 (2nd edition)
Azami 13346