The trade deficit refers to the merchandise account. We Americans buy more goods from foreigners than they buy from us. But merchandise is not the entirety of economic activity. Foreigners also buy services from us, and they invest here. There's no reason to worry that one account doesn't balance.
Foreign merchants have a limited number of ways to dispose of the dollars they earn from sales here.
They can buy American merchandise, services, or investments. If they don't want to do any of those things, they can trade their dollars for their own currency. But then the new holder of dollars faces the same choices. However you slice it, there's nothing to worry about. If everything is counted, the books must balance.