I could be wrong, but I don't think sanctions have ever really been effective at getting the intended results. Sometimes the affected country just starts a war. Other times, the country just seems to suck it up and keep on going forever.
We essentially defeated the Soviet Union with a long term, low grade economic war without all-out military engagement.
Star Wars (even if it was largely fake) was the nail in the coffin when they realized there was going to be no way their economy could compete with the expense that would take to match our efforts.
If China decides to go suicidal and start a shooting war with us that would be unfortunate. Americans would die, but no knowledgeable person has any doubt of the outcome of a full-scale conflict with the US.
However, the fundamental point is, the unexpected resolve of the West in the Ukraine example, and the object lesson of the difficulty of an invasion even under near ideal conditions, is changing China's ROI calculations of a Taiwan invasion as we speak, making it much less likely they will pull the trigger after all. Every dead Russian in Ukraine saves an American life in the Taiwan Straight. The Chinese aren't Jihadists. Suicide really isn't their jam.
The best chance a overall world peace is putting more warheads on Russian foreheads in Ukraine and utterly crushing them economically for generations. Russia has it coming, and China is watching.