The Prophet (SAW) said, “Afflictions (or civil wars) will occur, and there will be much Harj.” The companions asked, “What is Harj?” He said, “Killing. Killing.” (Sahih Bukhari)
The Prophet (SAW) said, “You will see after me (in the rulers) selfishness (or unjust preference) and things you disapprove (think are evil).” The companions asked, “What do you command us to do, Messenger of Allah?” He said, “Fulfill their rights, and ask Allah for your rights.” (Sahih Bukhari)

Introduction
Among the minor signs of the Day of Judgement is the spread of civil war and the ascension of evil and oppressive leaders. This is a sign we have seen throughout history until today. Time changes routinely. There is a civil war or an evil leader, then there is a good leader, then there is a civil war or an evil leader, then there is a good leader.
Infighting
There is no evil greater than when believers war with each other.
The Prophet (SAW) said, “I am not afraid that you will worship other than Allah after me, but I am afraid that you will fight with each other for worldly things.” (Sahih Bukhari)
Killing through wars between Muslims will increase so much near the end of times that a man who passes by a grave will wish he was in that grave instead, so he would not have to face the evil that he sees in the world.
Killing will increase and men will die in wars so much that women will at some point outnumber men fifty to one.
What to do during infighting?
The Prophet (SAW) strongly advised that we should stay away from wars between believers and not take part. If we can bring peace between two groups of believers, that has a great reward. If we cannot reconcile between them, we must stay away from joining one side in warring against the other.
The Prophet (SAW) said, “When two Muslims meet with weapons, the killer and the killed are in the fire.” People asked, “We understand the killer, but why is the killed in the fire?” He said, “Because he intended to kill his brother.”
There will be people of innovation who call to Hell in that time as well. If there is a clear leader for the Muslims, we should stick to that leader. If there is no clear leader and all factions in the war are dubious, then we must leave all factions even if that means going out and living in the desert to avoid being involved. (Sahih Bukhari)
In those civil wars, a person who sits will be better than a person who stands. The person who stands will be better than the person who walks. The person who walks will be better than the person who runs. Whoever exposes himself to it will be destroyed by it. Whoever finds a way to avoid it must avoid it. (Sahih Bukhari)
Evil Leaders
There have been many evil leaders that took authority over Muslims throughout history until today. There is nothing more harmful to the Muslim ummah than evil leaders, however that is a test Allah decided to test us with.
What to do under evil leaders?
Leaders over the Muslims can be divided into three categories: 1) Just, 2) Unjust, and 3) Disbelievers.
As for just and pious believers who rule over the Muslims, they must be obeyed except those commands that go against the laws of Allah. We should pray for Allah to keep them guided.
As for unjust, evil, and oppressive rulers that still remain Muslim and pray, they must be corrected and criticized without raising war against them. Their evil commands must be ignored, and their good commands should be obeyed.
Those who can should correct them even if that means risking their own safety and security. If someone cannot correct them or criticize them, he should at least know their actions are evil in his heart. Every person is responsible for what he can do. We should also pray to Allah that He guides them or exchanges them with better leaders.
As for rulers that deny Islam or refuse to pray, they must be resisted and fought with war (if feasible) until the land is restored to Muslim rule.
There are two extremes every Muslim should avoid.
There is one extreme of people who refuse to criticize rulers under the impression that criticizing them is not allowed. Some even go to the extent of defending evil rulers from criticism! The Prophet (SAW) said, “Whoever sees something wrong should change it with his hands. If he cannot do that, then with his tongue. If he cannot do that, then with his heart (he should believe it to be wrong), and that is the lowest level of faith.” (Sahih Muslim)
Hasan al-Basri and others from the Salaf used to say, “There is no backbiting with regards to an evil ruler.” That is because their sins are open, and open sins deserve open correction.
We should never side with evil rulers, especially not in the way of stopping people from criticizing their obvious evils.
There is another extreme of people who are not satisfied with criticism and correction and think any evil ruler is worthy of war or armed rebellion. The Prophet (SAW) used to take the following pledge from the Sahabah: “We pledge to listen and obey (the leaders), whether we are enthusiastic or reluctant, whether we are in difficulty or ease, even if he prefers others over us, and [we pledge] not to rebel against his authority except if you see blatant kufr which you have clear proof from Allah about.” (Sahih Bukhari)
The middle path is that evil rulers who are still Muslim should be corrected through any means other than war, because the death of war is worse than general injustice, and disbelief is worse than the death of war.
For more information, read Rulers: Criticism, Rebellion, and Disobedience – Fussilat Blog
Reason For This Minor Sign
The Prophet (SAW) told us about the coming civil wars and evil leaders so that the Sahabah and later Muslims would not think the subsequent civil wars were a failure on the part of the Prophet (SAW) or were evidence for the falsehood of Islam itself.
By predicting them and warning us about them, the Prophet (SAW) prepared us and assured us that this is part of the plan of Allah. Islam can be drowning with infighting or ruled by corrupt leaders, but that would not affect the teachings of Islam. That is a test from Allah that we must overcome as best as we can.
Today, we see people who think the weakness of Muslims is evidence Islam itself is wrong or that other ideologies are superior to Islam, or they think the strength of deviated people or disbelievers is evidence they are right, and all of that are characteristics of hypocrisy.
Allah revealed the following two verses in the Battle of Ahzab:
⟪And when the believers saw the confederates, they said, “This is what Allah and His Messenger had promised us, and Allah and His Messenger spoke the truth.” And it increased them only in faith and acceptance.⟫ (33:22)
⟪And [remember] when the hypocrites and those in whose hearts is disease said, “Allah and His Messenger did not promise us except delusion.”⟫ (33:12)