In economics what is the difference of debt vs deficit?

If a country has a deficit to other country? Like say for example the US deficit to China.

JuanB2021-04-07T17:50:13Z

Deficit is based on a given time period.  Like the current year, or last year.  Or last quarter year.

Debt is the total of all the deficits (and surpluses).  

It's harder to answer in terms of your example.  But the US Government 2020 Deficit was $3.1 Trillion, the total debt is $28.1 Trillion

Oiy2021-04-07T11:42:55Z

Deficit means imports more than exports. The deficit country needs hard currency, mostly USD, to pay for it. It might use the foreign resetves, or sell bonds in international markets to finance the deficit. In simple Keynesian model, the deficit occurs if the government has the budget deficit. That means expenditure exceeds the tax revenues. So the government hasto borrow the money to finance the budget deficit. So the deficit has become a public debt which hasto pay back by tax revenues. So public debts theoretically will come along with tax rise. In the  US, the Treasury will just issue bond to replace the old one which is expired. So it usually just pays for the interest.