At what point is emitting economic sanctions against a country an act of war? People mention that the U.S. blockading Japan during WW2 was an act of war, but if the U.S. and Western nations stopped trading with China over the Uighur detention camps, can China consider it to be an act of war? How does it work?
This is something for the recipient country to decide. They might consider sufficiently harsh economic sanctions an act of war, or they might not.
Quoting from Wikipedia's article on casus belli,
A casus belli played a prominent role during the Six-Day War of 1967. The Israeli government had a short list of casūs belli, acts that it would consider provocations justifying armed retaliation. The most important was a blockade of the Straits of Tiran leading into Eilat, Israel's only port to the Red Sea, through which Israel received much of its oil. After several border incidents between Israel and Egypt's allies Syria and Jordan, Egypt expelled UNEF peacekeepers from the Sinai Peninsula, established a military presence at Sharm el-Sheikh, and announced a blockade of the straits, prompting Israel to cite its casus belli in opening hostilities against Egypt.
At the other end of the extreme, even getting hit by a surprise preemptive attack was not viewed by Jeannette Rankin as a casus belli:
President Roosevelt formally requested [the US declaration of war against Japan] in his Infamy Speech, addressed to a joint session of Congress and the nation at 12:30 p.m. on December 8. The declaration was quickly brought to a vote; it passed the Senate, and then passed the House at 1:10 p.m. The vote was 82–0 in the Senate and 388–1 in the House. Jeannette Rankin, a pacifist and the first woman elected to Congress (in 1916), cast the only vote against the declaration, eliciting hisses from some of her peers. Several colleagues pressed her to change her vote to make the resolution unanimous—or at least to abstain—but she refused. "As a woman, I can't go to war," she said, "and I refuse to send anyone else."
There are different terms for different things:
Blockade: Warships of one country stopping ships from third countries from trading with another country, often by threat of military force. This is generally considered an act of war. The term blockade may also be applied to land borders, but unlike international waters countries can determine who is allowed to transit through their territory, so land blockades would usually not be acts of war.
Embargo: One country stopping their own citizens and companies from selling to another country. This is not an act of war.
Boycott: One country stopping their own citizens and companies from buying from another country. This is not an act of war.
Sanctions: A term applied to a comprehensive set of embargo and boycott measures, often by a group of nations.
Exception: There may be international treaties where a country agreed to special rules, notably the rights to transit. Violating these treaties may be considered an act of war.
Mankind came close to World War III in 1962 when the US Navy decided to stop Soviet ships from trading with Cuba. That was a blockade and an act of war, or it would have been if the Soviets had tried to push through and the US had fired on them.
So it would not be a casus belli if the US stopped to buy Chinese goods, for any reason. It would not be a casus belli if the US tried to convince others to do the same. It would be a casus belli if US warships tried to stop Chinese tankers from going to Iran, against the wishes of China and Iran.