Anas bin Malik reported,

The Messenger of Allah ﷺ said, "Help your brother, whether he is the wrongdoer or the wronged."A man asked, "Messenger of Allah, I understand helping him when he is wronged, but how do I help him when he is the wrongdoer?"He replied, "You restrain him or prevent him from committing the wrong. That is how you help him."

Bukhari 6952

Sahih

حدثنا محمد بن عبد الرحيم حدثنا سعيد بن سليمان حدثنا هشيم أخبرنا عبيد الله بن أبي بكر بن أنس

عن أنس رضي الله عنه قال

قال رسول الله ﷺ انصر أخاك ظالما أو مظلوما فقال رجل يا رسول الله أنصره إذا كان مظلوما أفرأيت إذا كان ظالما كيف أنصره قال تحجزه أو تمنعه من الظلم فإن ذلك نصره

البخاري 6952صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Coercion
Chapter
A man's oath that his companion is his brother, if he fears he will be killed or the like
Numbering
Darussalam 6952
Bukhari 6952