For the past decade, Brazil has lurched from one crisis to the next: environmental destruction, an economic recession, one president impeached, two presidents imprisoned and a pandemic that killed more people than anywhere else outside the United States.

On Sunday, Brazilians will cast their ballots for their next president, hoping to push Latin America’s largest country toward a more stable and brighter future — by deciding between two men who are deeply tied to its tumultuous past.

The election is widely regarded as the nation’s most important vote in decades, historians in Brazil say, in part because the health of one of the world’s biggest democracies may be at stake.