Answer:
Rather than raise taxes, governments often issue debt in the form of bonds to raise money.
During times of financial malaise, governments can buy back the very bonds that were issued, which was the policy called Quantitative Easing in the U.S. after the 2007-2008 financial crisis.
Tax hikes alone are rarely enough to stimulate the economy and pay down debt.
There are examples throughout history where spending cuts and tax hikes together have helped lower the deficit.
Bailouts and debt defaults can also help a government solve a debt problem, but these approaches have notable drawbacks as well