The F-35 is the best stealth aircraft you can have in a war against china. But it alone is not going to win that war. I wouldn't say it's the wrong jet for that war just because of that.
If you put the f-35 along all the rest of the us military, the war can be won and the f-35 plays a critical role in that win.
First, in a war with China, China would be in the (more) morally just position. Second, as you can see in Iran, in Korea, in Vietnam, etc (and that's just US wars), aircraft only inflict pain, they do not win. US imperialists would really really like for that not to be the case, but it is just not. You would need a boots on the ground, and a draft, and will still probably lose and maybe cause our own government to topple. The Vietnam war was lost not because we didn't have fancy toys, but because the revolutionaries fought so hard and well that the U.S. army about on the verge of rebellion.
China very successfully built a rich economic system that is the factory of the world while eroding our own domestic capacity. In a war they can cut us off. We are not even as strong as we were during the Vietnam war, though we have fancier toys. Good luck!
There is no in winning a war between the US and China, even assuming it doesn't go nuclear. There would only be losers all over the world. It would make the current Iran conflict look like a tiny speedbump (albeit one which is likely to cause malnutrition and starvation for millions of people in subsaharan Africa within 6-12 months).