Hazrat Ali (a.s.) fought three battles against his enemies during his caliphate of four years and nine months. These battles include:
The Battle of Jamal in 36 AH with the Naqsh-e-Naq These two naive companions were deceived by Muawiyah's letter and decided to go from Medina to Mecca and gather people and equipment for war there. Aisha, the wife of the Messenger of God (peace be upon him), also rode with them on a red-haired camel to fight. Aisha said: "People! Uthman has been killed unjustly and I will avenge his blood." While according to history itself, these three people had the greatest share in killing Uthman.
The Battle of Jamal ended in a one-day but hard fight, with many casualties on both sides and the defeat of the Naqsh-e-Khatin, and Imam Ali sent Aisha with his brother Muhammad bin Abi Bakr to Basra and from there to Medina with a number of Basra men and women.
After the Battle of Jamal, Imam Ali chose Kufa as the center of the caliphate and since he knew that the rebellion of the treaty-breakers was one of the sins of Muawiyah who encouraged them to break the treaty, he moved from Kufa with a large army and encountered Muawiyah in the desert of Siffin. And thus, a hard and long battle broke out between the armies of Iraq and Syria.
Although the Battle of Siffin went in favor of the Imam (a.s.), due to the ignorance of some and the deceit of Amr al-As, the matter went to arbitration. In the arbitration, Abu Musa al-Ash'ari, who had been chosen as the arbitrator against the will of Imam Ali (a.s.), acted ignorantly and the caliphate fell to Muawiyah.
After the Battle of Siffin, the ignorant people who agreed to arbitration said that they had sinned and repented, "Ali" should also repent! Then they gathered in a place called Nahrawan and began to disrupt the work of the Imam (a.s.). The Imam's efforts to guide them were futile, so he sent an army to fight them, which ultimately ended with the defeat of the Khawarij in the Battle of Nahrawan.