That was the fundamental problem.
There are certain solutions to that problem that can involve devaluing your currency, which can make it much cheaper to manage the problem. And the EU could have done that, but because the EU was strongly opposed to fiscal measures at the time (that has thankfully changed since the pandemic, which has made the EU a much more useful organization), they didn't.
So a lot of people got mad at the EU about it and pretended that Greece would have been better off with their own currency to depreciate. However, there are 2 major problems with that alternate scenario:
1) If Greece was still on the Drachma, it's highly unlikely that Greece would have been borrowing money on the Drachma. They would have most likely have borrowed money in Dollars, or maybe Euros, because the Drachma was simply not powerful enough. So devaluing their currency would not have helped them with their international borrowing which was the problem in the first place (it would only have made those loans even more expensive).
2) If Greece was still on the Drachma, it's highly likely the Drachma would have collapsed, and Greece would have faced dramatic inflation, the likes of which are ruining countries like Turkey and Pakistan right now.
Think about it this way. The vast majority of wealth every Greek person in Greece would have been in Drachma. But if the value of the Drachma fell by 25%, that would mean that in one fell swoop, every Greek person lost 25% of their wealth. And currency inflation is even worse than having 95% of your net worth in your house, and seeing its price crash by 25%, because currency is what you conduct your day to day transactions in. At least with the house, assuming you don't have to pay the mortgage or you do have enough to pay the mortgage, you don't need to liquidate it at those reduced values. But if you want to buy food, you need to use currency, and so you need to realize the lowered value of your wealth immediately.
By being on the Euro, however, thanks to the fact that the value of the Euro was largely derived from other more stable countries, the Greek people did not actually lose their own personal wealth, since the Euro did not depreciate much.