Why is trade deficit a good thing? In general most economist agree that deficit is not a negative thing, but I have trouble understanding why

For example if country A has 10\$ and country A runs trade deficit to B of 2\$ per year, doesn't this necessary mean that in 5 year country A can no long buy product from other country?

I think I am missing something important here. How can a country run trade deficit multiple years without eventually going bankrupt? 

One reason that I have been given is that since country A buys country B's product in country A's currency, country B must use that currency in country A, thus the trade is balance in the long run, is that true?
First off, just because economists say that the trade deficit is not a negative thing, does not mean it is positive.

Yes, trade is balanced in the long run. In and of itself, a trade deficit is therefore not necessarily an issue.

When a country runs a trade deficit that means that it is consuming more than it produces. The country consumes at least as much as it produced and then a bit from what other countries produced too. That in itself is not a bad thing. In fact, consuming more than you produce seems rather nice.

However, a trade deficit may also be a symptom of other economic weaknesses. A perpetual deficit may also be the precursor to a crisis. So whether a deficit in a certain case is bad or good depends on the circumstances. A good source is this IMF report.

That being said, it is incorrect and a bit naive to simply see every trade deficit as a problem.