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:31:17

O my son, establish prayer, enjoin what is right, forbid what is wrong, and be patient over what befalls you. Indeed, ˹all˺ that is of the matters ˹requiring˺ determination.  

O my son! Establish prayer and enjoin decency and forbid indecency. And be patient through whatever may befall you, as a result of such enjoining and forbidding. Truly that, which is mentioned, is true constancy, in other words, that is one of those necessary things regarding which one must have firm resolve.
القرآن:٣١:١٧

يَا بُنَيَّ أَقِمِ الصَّلَاةَ وَأْمُرْ بِالْمَعْرُوفِ وَانْهَ عَنِ الْمُنْكَرِ وَاصْبِرْ عَلَىٰ مَا أَصَابَكَ ۖ إِنَّ ذَٰلِكَ مِنْ عَزْمِ الْأُمُورِ  

{يا بنيّ أقْم الصلاة وأمُر بالمعروف وانْهَ عن المنكر واصبر على ما أصابك} بسبب الأمر والنهي {إن ذلك} المذكور {من عزم الأمور} أي معزوماتها التي يعزم عليها لوجوبها.