In the name of Allah, the Beneficent, the Merciful
It is not permissible for a Muslim without judicial authority to implement Islamic legal punishments on his own initiative. Vigilante justice, or “taking the law into your own hands,” is unlawful in Islam because it will lead to chaos and possibly greater harm than the crimes themselves. Likewise, it is not permissible for a Muslim to declare war or to commit an act of war without lawful authority.
Abu Huraira reported: Sa’d ibn Ubadah said, “O Messenger of Allah, if I find another man with my wife, should I leave him alone until I bring four witnesses?” The Prophet said yes. Sa’d said, “Never! By the one who sent you with the truth, if that happened to me I would quickly grab the sword!” The Prophet, peace and blessings be upon him, said:
اسْمَعُوا إِلَى مَا يَقُولُ سَيِّدُكُمْ
Listen to what your leader is saying.
Source: Sahih Muslim 1498, Grade: Sahih
In this example, the Prophet has forbidden a man who witnesses his wife committing adultery from implementing legal punishment by his own initiative. This is because legal punishments may only be applied by appointed judges and because the punishment for adultery requires the testimony of four reliable witnesses.
Ibn Muflih writes:
تَحْرُمُ إقَامَةُ حَدٍّ إلَّا لِإِمَامٍ أَوْ نَائِبِهِ
It is forbidden to establish a legal punishment unless it is done by the leader or his deputy.
Source: Al-Furu’ 6/53
Sheikh Hani Al-Jubayr, judge at the Jeddah Supreme Court, writes:
The prescribed punishments in Islamic Law are only to be issued by the judge, since due process and proper procedures of evidence must be observed. They must thereafter only be carried out by properly empowered government officials. Otherwise things will deteriorate into public violence that may bring about dire consequences.
Source: Islam Today
Therefore, a Muslim who witnesses a crime should inform the local authorities who will take appropriate action. He should never attempt to implement legal punishments on his own.
Success comes from Allah, and Allah knows best.