Macroeconomics was born as a result of one of the worst financial collapses in human history: the 1930's great depression. Since then, a rich and comprehensive literature on the causes and economic consequences of financial crises has arisen. However, despite our ever-growing understanding of extreme financial events, the evolutionary nature of the world economy implies that crises continue to occur in both, known and unknown shapes and forms. As shown by the 2008's great recession, economists and policymakers often find themselves voiceless when confronted with the unexpected outcomes of modern-day financial collapses. This dissertation studies financial crises in emerging and developing countries. We focus on these countries because seventy-five percent of all the registered events of financial distress that occurred between 1970 and 2010, happened in these economies (Reihart and Rogoff, 2011). The chapters presented in this document, investigate the three main subjects associated with financial crises: origins, prevention, and management. Economists have been very successful in understanding the causes and consequences of financial crises over, among others, income, trade, employment, and poverty. However, when determining policy mechanisms that allow for effective prevention and efficient management policies, results have been mixed. This dissertation contributes to the literature by proposing an innovative perspective on the prevention and management of financial crises.Chapters 1 and 2 focus on the roots of financial crises and the formulation of optimal macroprudential policy. Specifically, we look at different scenarios in which imperfect credit markets lead to an increase in the frequency and the severity of financial collapses. We study the characteristics of the optimal policy that minimizes the occurrence of crises and restores efficiency in the market. Chapter \ ef{chap:ch1} analyzes the relationship between information frictions and financial constraints. In particular, we relax the perfect information assumption in a small open economy with collateral constraints. Under such a condition, households observe income growth but do not perceive whether the underlying shocks are permanent or transitory. We find that the likelihood and severity of financial crises increase due to the interaction between the information friction and a pecuniary externality that emerges when households use an asset valued at market prices as collateral. Our results also show that the optimal tax to restore constrained efficiency is six times larger than under perfect information. Chapter 2 provides a quantitative link between the macroeconomic relevance of overborrowing and the significance of permanent shocks to the economy. We propose an innovative approach to estimate the unobservable permanent and transitory components of income and show that as the transitory-to-permanent volatility ratio decreases, the degree of overborrowing in a decentralized economy converges to zero. Moreover, as the permanent shocks to income become more relevant to the economy, the number of crises occurring because of overborrowing falls.In chapter 3, we turn our attention to the case of economies with highly indebted governments that are forced to reduce their Debt-to-GDP ratio in order to bring the budget under control. The chapter proposes a quantitative framework that sheds light on the optimal path that authorities can follow to achieve fiscal consolidation. We argue that the optimal design of a consolidation plan must consider the transition dynamics of the economy and maximize either welfare or another measure of prosperity. Our quantitative model explores the case of small open economies under different monetary policy regimes. We conclude that currency devaluation is a critical factor in stabilizing output during a fiscal contraction.