Star Wars fans have debated whether the Jedi are heroes or villains for much of the saga's long history, often arguing whether the group's actions during the prequel era were justified. However, one thing that's hard to deny is that the Jedi weren't all that successful at being the "guardians of peace and justice in the Old Republic" Obi-Wan Kenobi described in A New Hope.
The Skywalker Saga is ultimately a story of revolution, how an old system that failed its people crumbled, how evil rose to power in the power vacuum,and how, in the end, society rebuilt itself, drawing both from the old ways the old order forgot as learning from the new lessons of the new present. In short, the Skywalker Saga is the story about how the Jedi were replaced by a system that works better.
What was the Jedi Order's Job?
In the original trilogy, the Jedi Order are two things: guardians of peace and monks. While we understand that Obi-Wan and Anakin Skywalker both served in the Clone Wars, we don't gain a sense that the Jedi Order are a military structure.
The Jedi Order functions as a branch of government that refuses to accept oversight from government bodies. In their introduction in The Phantom Menace, the Jedi are dealing with what looks like a trade dispute. Later on in the film, when the Senate fails to help Naboo, the Jedi defy the Senate and military action on their own terms, never to be held accountable. In both Attack of the Clones and Revenge of the Sith, they organize military operations, commanding the Clone Army drafted by the Republic.
The Jedi aren't only soldiers -- they're also cops. Throughout Attack of the Clones, Obi-Wan serves the role of detective, investigating the entire Clone conspiracy and the Separatist division. When Anakin and Obi-Wan pursue Zam Wesell in Coruscant, they conduct themselves as officers pursuing a suspect, with Anakin even telling observers to keep their heads down because they're doing "Jedi business."
What makes this bewildering is that the Jedi in the original and sequel films are distinctly separate from government operations. Luke fights as a soldier in the Rebellion, mainly focusing on training in the ways of the Force or confronting his father. He embodies the ideals of the Jedi in theory, which is arguably why when confronted with the reality of the Jedi he becomes so dismissive. The same is true for Rey, who spends most of the sequel trilogy trying to either inspire good in Kylo Ren or helping fight for order in the New Republic as a part of the team, not as its general. The prequels are the only films where the Jedi control every aspect of society.
Darker Tactics
While Obi-Wan and Yoda are good people, the Jedi Order often veered in darker directions. Neither Yoda or Obi-Wan seemed to go along with Mace Windu's more assertive, sometimes violent actions. In the films, most of the tactics taken to remove Chancellor Palpatine from power are undertaken by Windu. While Palpatine is evil, Windu is nonetheless performing a military coup against the leader of the Republic and defying the law to rule. Windu states how he believes the Jedi Order needs to control the Republic to secure peace. This isn't even going into the failed military operations Windu orchestrates in the Expanded Universe, like in the novel Dark Disciple.
The Jedi arrogantly treated the Force as a weapon, when in reality the Force is far larger and more complex, as Luke illustrates in The Last Jedi. They'd regularly take children from parents to groom into military soldiers. The Separatists, after all, didn't just leave the Republic arbitrarily. They resented the Jedi regime.
Tellingly, the most successful of the Jedi actually resented the Order's violent legacy, only using violence as a last means. Luke's greatest moments -- redeeming Vader, his confrontation with The First Order -- are successful because he didn't use violence to solve the problem. The same is true for Rey. The successful Jedi were used violence as a last resort, not the first.
In Your Arrogance...!
Perhaps the biggest overall problem with the Jedi is their refusal to listen or be open with the world outside their small circle. In their wisdom, the Jedi Order seems compelled to be as secretive and elitist as possible. Count Dooku's insurrection is dismissed outright by the Jedi Council because Dooku was once a Jedi. The Jedi's connection to the Force is diminished throughout the prequels, but they keep that a secret for reasons. They refuse to draft students unless they are young so that they can be properly groomed into being subservient, cultish members of their sect.
Their biggest mistake is that they refuse to be open with Anakin throughout the prequels. Their misgivings about Anakin are valid, but their refusal to discuss matters openly with him leads to Anakin lose faith in them and turn to the dark side. If Mace Windu spoke frankly to Anakin about why he made the decisions he did pertaining to his treatment, there's a good chance Anakin might not have cut his hand off at a key moment.
What makes this more remarkable is that almost every decision the Jedi make is ultimately deconstructed in later films. Obi-Wan and Yoda insist Luke has to kill Darth Vader. Luke doesn't, and things work out. Luke is 100% correct when he states the Jedi's legacy is arrogance. The fragments of the Jedi Order only succeed when they drop the military trappings. Rey healing Kylo Ren and Luke refusing to fight Vader bring peace to the galaxy. Obi-Wan insisting Anakin needs to die leads to Darth Vader. Ultimately, the Skywalker Saga shows that society needed to grow beyond the Jedi.