Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:17:33

And do not kill the soul which Allah has forbidden, except by right. And whoever is killed unjustly - We have given his heir authority, but let him not exceed limits in ˹the matter of˺ taking life. Indeed, he has been supported ˹by the law˺.  

And do not slay the soul ˹whose life˺ God has made inviolable, except with due cause. Whoever is slain wrongfully, We have certainly given his heir, the one inheriting from him, a warrant, a sanction ˹to retaliate˺ against the slayer; but let him not commit excess, ˹let him not˺ overstep the bounds, in slaying, by slaying other than the killer ˹of the one slain˺, or by other than that ˹instrument˺ with which he ˹the slain˺ was killed; for he is supported ˹by the Law˺.
القرآن:١٧:٣٣

وَلَا تَقْتُلُوا النَّفْسَ الَّتِي حَرَّمَ اللَّهُ إِلَّا بِالْحَقِّ ۗ وَمَنْ قُتِلَ مَظْلُومًا فَقَدْ جَعَلْنَا لِوَلِيِّهِ سُلْطَانًا فَلَا يُسْرِفْ فِي الْقَتْلِ ۖ إِنَّهُ كَانَ مَنْصُورًا  

{ولا تقتلوا النفس التي حرم الله إلا بالحق ومن قُتل مظلوما فقد جعلنا لوليه} لوارثه {سلطانا} تسلطا على القاتل {فلا يسرف} يتجاوز الحد {في القتل} بأن يقتل غير قاتله أو بغير ما قتل به {إنه كان منصورا}.