In The Name of Allaah, The Most Merciful, The Bestower of Mercy.
Imaam Abdul Azeez Bin Baaz [rahimahullaah] said:
The path to victory is through learning the Sharee’ah and acquiring understanding in the Deen of Allaah by the rulers, those under the ruler’s authority, the elders and the young; acting upon what this learning and understanding necessitates, and abandon that which Allaah has forbidden. Allaah [The Exalted] said: [ إِنَّ ٱللَّهَ لَا يُغَيِّرُ مَا بِقَوۡمٍ حَتَّىٰ يُغَيِّرُواْ مَا بِأَنفُسِہِمۡۗ – Verily! Allaah will not change the good condition of a people as long as they do not change their state of goodness themselves (by committing sins and by being ungrateful and disobedient to Allaah)]. [13:11]
Therefore, whoever wishes for victory and assistance from Allaah, and to make the word of (Allaah) uppermost, then he should change that which he is upon of disobedience, sins and opposition to the command of Allaah. And your Lord has stated:
وَعَدَ ٱللَّهُ ٱلَّذِينَ ءَامَنُواْ مِنكُمۡ وَعَمِلُواْ ٱلصَّـٰلِحَـٰتِ لَيَسۡتَخۡلِفَنَّهُمۡ فِى ٱلۡأَرۡضِ ڪَمَا ٱسۡتَخۡلَفَ ٱلَّذِينَ مِن قَبۡلِهِمۡ وَلَيُمَكِّنَنَّ لَهُمۡ دِينَہُمُ ٱلَّذِى ٱرۡتَضَىٰ لَهُمۡ وَلَيُبَدِّلَنَّہُم مِّنۢ بَعۡدِ خَوۡفِهِمۡ أَمۡنً۬اۚ يَعۡبُدُونَنِى لَا يُشۡرِكُونَ بِى شَيۡـًٔ۬اۚ
Allaah has promised those among you who believe, and do righteous good deeds, that He will certainly grant them succession to (the present rulers) in the earth, as He granted it to those before them, and that He will grant them the authority to practise their religion, that which He has chosen for them (i.e. Islaam). And He will surely give them in exchange a safe security after their fear (provided) they (believers) worship Me and do not associate anything (in worship) with Me. [24:55]
Allaah [Glorified be He and free is He from all imperfections] did not say that He has made a promise to those who attribute themselves to the Quraish, the Arabs or those who build castles and excavate petrol, rather Allaah associated this affair to true Eemaan and righteous action-regardless whether they are Arabs or non-Arabs. [Ref 1]
Imaam Muhammad Ibn Saaleh Al-Uthaymeen [rahimahullaah] said: Indeed, defeat against the Muslims occurred due to one act of disobedience [i.e. at the battle of Uhud]. At present we want victory whilst disobedience is rife amongst us, so due to this it is not possible for us to rejoice with victory as long as we are upon this state of affairs; unless Allaah shows us kindness and rectify us. [Ref 2]
Shaikh Saaleh Al-Fawzaan [hafidhahullaah] said: [A person] should not lose hope when trials and evil increases. Indeed, he has to remain upon tranquillity and should make others tranquil when trials occur, and he should say: ‘’All Praise is due to Allaah, we are upon guidance and a clear Religion. Solace is close by and evil will cease to exist by the permission of Allaah’’ This is what is incumbent upon THE PEOPLE OF GOOD AND THE SCHOLARS–that they have tranquillity and make the people tranquil; because this (EVIL) is something that will cease to exist by the permission of Allaah and solace will come after it.
It is not permissible for a person to say: ‘’the people are destroyed.’’ This is not permissible; rather (a person) should make the people tranquil, firm upon goodness, whilst expecting assistance, for indeed the good end is for the people of piety. Therefore, no matter how great the evil and trial is, it will cease to exist. He (sallal-laahu-alayhi-wasallam) said: ‘’A group of my followers will remain manifest upon the truth. They will neither be harmed by those who forsake them nor by those who oppose them till Allaah’s command arrives.” [i.e. the day of judgement] [Bukhari and Muslim]
Therefore, Islaam will not cease to continue and all praise be to Allaah. The Religion and the Qur’aan will not cease to exist until that appointed time which the prophet (sallal-laahu-alayhi-wasallam) has informed us of – that at the end of time the Qur’aan will be taken away from the hearts of men and from the masaahif (i.e. the copies of the Qur’aan); but this will be at the time of the destruction of the world. (However) good will continue to exist whilst the Qur’an, the Sunnah and the Qiblah are present, even though there is one who is led away from it and becomes misguided; and even though there is one who deviates from it and becomes deviated, as the saying goes: ‘’Fitnah has its victims’’. It takes away the one who goes with it; but the people of Eemaan will remain even if they are small in number. Even if there is one who goes along with the Fitnah, and the one who goes astray and the one who comes along with it, (still) the truth and its people will remain and all praise be to Allaah. The truth is present, as Allaah (The Exalted and Most High) said: [إِنَّا نَحْنُ نَزَّلْنَا الذِّكْرَ وَإِنَّا لَهُ لَحَافِظُونَ – Verily We: It is We Who have sent down the Dhikr (i.e. the Qur’an) and surely, We will guard it (from corruption) 15:9]
A person should not lose hope nor should he despair. He should not make the people lose hope of a return to goodness. He should not make the people lose hope regarding (the fact) that truth will prevail and falsehood will be repelled because Allaah (Glorified and Exalted Be He) has made that promise and He does not fail to fulfil His promise. Imaam Ibnul Qayyim (rahimahullaah) said: ‘’The Religion is aided when put to the test; therefore do not be amazed for this is the way of Ar-Rahmaan (The Most Merciful). [Ref 3]
Allaah (The Most High) said:
وَنُرِيدُ أَن نَّمُنَّ عَلَى ٱلَّذِينَ ٱسۡتُضۡعِفُواْ فِى ٱلۡأَرۡضِ وَنَجۡعَلَهُمۡ أَٮِٕمَّةً۬ وَنَجۡعَلَهُمُ ٱلۡوَٲرِثِينَ
وَنُمَكِّنَ لَهُمۡ فِى ٱلۡأَرۡضِ وَنُرِىَ فِرۡعَوۡنَ وَهَـٰمَـٰنَ وَجُنُودَهُمَا مِنۡهُم مَّا ڪَانُواْ يَحۡذَرُونَ
”And We wished to do a favour to those who were weak (and oppressed) in the land, and to make them rulers and to make them the inheritors; and to establish them in the land, and We let Fir’aun (Pharaoh) and Haman and their hosts receive from them that which they feared.” [28:5-6]
Imaam Shanqeeti (rahimahullaah) said: We have already stated that Allaah’s statement in this ayah [وَنُرِيدُ أَن نَّمُنَّ عَلَى ٱلَّذِينَ ٱسۡتُضۡعِفُواْ فِى ٱلۡأَرۡضِ And We wished to do a favour to those who were weak (and oppressed) in the land] is the (intended meaning) in His (other) statement:[وَتَمَّتۡ كَلِمَتُ رَبِّكَ ٱلۡحُسۡنَىٰ عَلَىٰ بَنِىٓ إِسۡرَٲٓءِيلَ And the fair Word of your Lord was fulfilled for the Children of Israel (7:137)].
And He (Allaah) did not clarify in (the ayah 28:5) the reason for making them (i.e. Bani Israa’eel) leaders – meaning, leaders to good and callers to Him (i.e. to the path of Allaah). Likewise, He (Allaah) did not clarify the reason for making them inheritors, but He (The Most High) clarified all of that in other places (in the Qur’aan). So He (Allaah) clarified the reason for making them leaders in His saying: [وَجَعَلۡنَا مِنۡہُمۡ أَٮِٕمَّةً۬ يَہۡدُونَ بِأَمۡرِنَا لَمَّا صَبَرُواْۖ وَڪَانُواْ بِـَٔايَـٰتِنَا يُوقِنُونَ –And We made from among them (Children of Israel), leaders, giving guidance under Our Command, when they were patient and used to believe with certainty in Our Ayat (proofs, evidences, verses, lessons, signs, revelations, etc.)].
[And with regards to His (Allaah) saying: وَأَوۡرَثۡنَا ٱلۡقَوۡمَ ٱلَّذِينَ كَانُواْ يُسۡتَضۡعَفُونَ مَشَـٰرِقَ ٱلۡأَرۡضِ وَمَغَـٰرِبَهَا- And We made the people who were considered weak to inherit the eastern parts of the land and the western parts thereof….] He clarified what He made them inherit, saying: [كَمۡ تَرَكُواْ مِن جَنَّـٰتٍ۬ وَعُيُونٍ۬ — How many of gardens and springs do they [Fir’aun’s (Pharaoh) people] left]. [وَزُرُوعٍ۬ وَمَقَامٍ۬ كَرِيمٍ۬–And green crops (fields etc.) and goodly places] [وَنَعۡمَةٍ۬ كَانُواْ فِيہَا فَـٰكِهِين– And comforts of life wherein they used to take delight!] [كَذَٲلِكَۖ وَأَوۡرَثۡنَـٰهَا قَوۡمًا ءَاخَرِين– Thus (it was)! And We made other people inherit them (i.e. We made the Children of Israel to inherit the kingdom of Egypt) [44:25-28]
And (also) His (The Most High) saying: [فَأَخۡرَجۡنَـٰهُم مِّن جَنَّـٰتٍ۬ وَعُيُونٍ۬– So, We expelled them from gardens and springs] [وَكُنُوزٍ۬ وَمَقَامٍ۬ كَرِيمٍ۬ — Treasures, and every kind of honourable place][ كَذَٲلِكَ وَأَوۡرَثۡنَـٰهَا بَنِىٓ إِسۡرَٲٓءِيلَ– Thus [We turned them (Pharaoh’s people) out] and We caused the Children of Israel to inherit them] [26:57-59] 
[وَنُرِىَ فِرۡعَوۡنَ وَهَـٰمَـٰنَ وَجُنُودَهُمَا مِنۡهُم مَّا ڪَانُواْ يَحۡذَرُون ] [And We let Fir’aun (Pharaoh) and Haman and their hosts receive from them that which they feared] for indeed they were informed that they would be destroyed through the hands of a man of Bani Israa’eel, so they were afraid of them. However Allaah made them received what they feared. 
Imaam Sadi (rahimahullaah) said: If Allaah wishes that an affair (should take place), He makes the means to it easy and makes its paths distinct. 
[Ref 1]: [Source: An Excerpt from a booklet titled: Your Enemies Are About To Gather Against You: ‘The Causes Of The Weakness of The Muslims In The Presence Of Their Enemy. Page 29. Slightly paraphrased]; [Ref 2] Al-Qawlul Mufeed Alaa Kitaab At-tawheed 1/289. Slightly paraphrased; [Ref3]:https://salaficentre.com/2019/08/admonition-from-the-hadeeth-of-hudhaifah-people-used-to-ask-the-messenger-of-allaah-about-the-good-times-but-i-used-to-ask-him-about-bad/
[Ref 4: ‘Adwaa Al-Bayaan’ of Imaam Shanqeeti (rahimahullaah). Vol 6. Page 282]; [Ref 5: ‘Zaadul Maseer’ of Imaam Ibnul Jawzi (rahimahullaah). Page 1057]; [Ref 6: Tayseer Al-Kareem Ar-Rahmaan Fee Tafseer Kalaam Al-Mannaan’ of Imaam Sadi. Page: 582. Publisher: Daar Ibn Hazm