Governments really aren’t in this whole “staying afloat” business either, that’s corporate as well. Governments make the rules entirely, so they can be indebted to their citizens, their corporations, and even over governments and be totally fine.
They realistically need to have some sort of pathway to be chipping at their debts, but many can go into much deeper debt to churn out social programs that add value to their economies in the long term.
For instance a country could go into debt so all their citizens could have free access to schooling and college, and it would be net positive for that country because the those citizens could contribute more towards the economy than they could without that free education.
Another example is paying for bullet trains, nuclear power plants, solar energy panels, etc. are all worth the investment and worth going into debt for since they add so much value back to economies and open up new jobs.