Do local taxes help in paying back foreign debts? I always wonder if increasing local taxes could help countries in paying off the foreign debts?

I think taxes generate income in local currency. While foreign debts (from IMF, World Bank etc.) are to be paid in USD. How could this help out?
If you actually raise local tax it would help you can just convert the money raised with local tax into the currency in which the debt is. For example, if UK has some debt in Euros they can raise taxes in pounds and just exchange them at an exchange rate for euros and pay down their euro denominated debt.

However, it would not be possible to pay the foreign debt by just printing the local currency as that would lead to depreciation of local currency and hence its exchange rate.