If a random country is in debt, is printing money a good way to pay it off at the expense of the citizens?
Printing money to pay for the debts is never a good way for the nation and for the currency overall value in the global economy. Consider that an item is being sold for $10 and when there is twice the money which was printed, the item will become expensive and would be worth more than what it is intended to be. Here when the item becomes expensive, we would be seeing an inflation where the item is worth more than the money itself. This would counter the purpose of money and moreover repeated incoming of money in the form of newly printed notes would further rise the price of an item quite frequently.
We should be well aware of the inflation problems in Weimar Republic (Germany) where money became totally worthless and was abundantly found in the streets. Money abundantly found and printed would create further problems which would defeat the purpose of money on the whole. Gold is worth the cost only when they have limited supply, if there were unlimited supply it would get devalued like Dogecoin.

As abhiseshakana said, barter would always serve the purpose when the opposite party who is involved in the trade is in need of the good which we are willing to trade with them. Money has become digital with the invention of bitcoin and can be stored in a mobile and can be very handy but barter doesn't go by the way.