If what you have in mind via your question is the well-known macroeconomic identity $C + S + T ≡ Y ≡ C + I + G + X$, read The Identity-Equals-Causation Fallacy, Yet Again. Below, an extract that addresses your How:
There is no causation at work here. Net exports does not cause net borrowing (budget deficit), nor is it the other way around; they are identical to one another, different ways of recording the same economic events.
In conclusion, while addressing your US-*vs*-China concern: the accounting-like shortcut that consists of saying that USA debt to China is actually used to import goods from China is not the factual reality, *only an accounting one*.
How does a budget deficit help grow a trade deficit?
The causality has to be considered in the opposite direction. The real (and simplified) story behind is that, when importing/buying goods from another country, a U.S. private company is not doing so from a local one who would pays taxes and thus generates tax revenues for the U.S. government, which would in turn allow the latter to contract less debt when e.g. ensuring the continuity of its social system.