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:22:41

˹And they are˺ those who, if We give them authority in the land, establish prayer and give zakah and enjoin what is right and forbid what is wrong. And to Allah belongs the outcome of ˹all˺ matters.  

those who, if We empower them in the land, by granting them victory over their enemies, maintain the prayer, and pay the alms, and enjoin decency and forbid indecency (this ˹last˺ is the response to the conditional clause, which together with the response constitute a relative clause of the relative noun ˹‘those who’˺; hum, ‘they ˹are˺’, may be taken as the implied subject before this). And with God rests the outcome of all matters, in other words, to Him these ˹matters˺ return in the Hereafter.
القرآن:٢٢:٤١

الَّذِينَ إِنْ مَكَّنَّاهُمْ فِي الْأَرْضِ أَقَامُوا الصَّلَاةَ وَآتَوُا الزَّكَاةَ وَأَمَرُوا بِالْمَعْرُوفِ وَنَهَوْا عَنِ الْمُنْكَرِ ۗ وَلِلَّهِ عَاقِبَةُ الْأُمُورِ  

{الذين إن مكانهم في الأرض} بنصرهم على عدوهم {أقاموا الصلاة وآتوا الزكاة وأمروا بالمعروف ونهوا عن المنكر} جواب الشرط، وهو وجوابه صلة الموصول، ويقدر قبله هم بمبتدأ {ولله عاقبة الأمور} أي إليه مرجعها في الآخرة.