Taiwan Is a Nightmarish Country to Effectively Occupy
I think it's probably good that the US is remembering the existence of strategic geopolitical adversaries again, but I'm really doubtful that the US would get humiliated in any near-term conflict with China. I Am Not A Defense Analyst, so take the below with a pinch of salt, but I spend way too much time on various geopolitics and military subs so I think most of the below is along the right lines (though I welcome correction).
First, and most important, any US-China conflict would probably involve Taiwan, and invading Taiwan is a logistical nightmare. People here are discussing the tough time the US had with the Taliban in Afghanistan, but Taiwan has its own set of horrible problems for any would-be invader. One is the sheer challenge of conducting a large scale amphibious invasion over a strait that is 80 miles at its narrowest (roughly the distance the D-Day landings had to cover under much more favourable conditions). Amphibious landings have also been made more difficult by technology. Preparations for any attempted invasion would take weeks or months, and satellite surveillance would make them all but impossible to conceal. Likewise, developments in missile and precision munition technology would allow for the destruction of landing craft and support ships from considerable distances even without air superiority.
I've heard it suggested that China would rely on landing troops en masse via helicopter to secure beaches, but again, even under conditions of air superiority, these would be vulnerable to MANPADs. More to the point, it's very unlikely that China could land even close to enough infantry and heavy equipment by air to secure air strips or beachheads. It doesn't have a huge heavy-lift helicopter fleet to begin with, and has no means of bringing large quantities of heavy equipment onto the island. And bear in mind, Taiwan has approximately 1200 tanks (by contrast, the UK has approximately 200). A lot of these are outdated, but they could cause a ton of trouble for a light infantry force.
All of this is assuming air superiority. But establishing air superiority would probably take at least a few days for China. Taiwan has lots of air defenses in places, and a decent (if small) air force of its own. The only standouts are its F-16 fleet. But bear in mind it took a week for the coalition to establish air superiority over Iraq in Desert Storm, and conditions there were arguably more favourable for the attackers.
And the longer the conflict goes on, the worse things look for China, at least assuming US involvement. There are a lot of justifiably panicked scenarios about the loss of a carrier, but the US has enough airbases in the region (particularly Okinawa) that it could provide some air support to Taiwan even keeping its carriers safe. The US also has comparable numbers of submarines to China, and they're generally of a better quality. And of course, carrier groups probably would get involved, even if the US was careful with them. My guess is that sinking a carrier would be a terrible move for China, as it would absolutely galvanise US commitment to a sustained war. But the big takeaway here for me would be that invading Taiwan is already a very difficult endeavour, and it'd take long enough that the US would almost certainly be able to get involved, landing supplies and provide air support, which would make the invasion all but impossible.
Even if China did manage to get a foothold in Taiwan, it's a nightmarish country to effectively occupy, with mountains in the East, and lots of built up urban areas in the West. And urban warfare is probably the hardest kind of warfare there is, especially in the modern age. If the population of Taiwan were committed to a serious guerilla campaign, they would have a lot of advantages, especially if the waters around Taiwan were still contested and the US could continue to supply them.
And the longer the war goes on, the more it (mostly) favours the US. In particular, the dominance of the American blue water navy would allow for a very effective blockade of the Straits of Malacca. China still imports a lot of its oil by sea that couldn't easily be re-routed, and while it has a substantial reserve, a US blockade would immediately set a timer ticking. And as long as the US has blue-water dominance (something it's likely to retain for at least a couple of decades), it'll be able to prevent China from importing and exporting at scale via a blockade, which will cause severe economic pain the longer it goes on.
Finally, there's the fact that the US has much better allies than China. The US has a vast web of alliances to work from. NATO is the obvious one, but the emergence of The Quad is a huge threat to China. By contrast, China has a one first-class strategic partner in the form of Russia, though I can't see the latter going to war with the US and risking nuclear war for the sake of a regional conflict like Taiwan. China has some weaker allies in the likes of Iran, Myanmar, and increasingly Pakistan, but they all have regional adversaries that are US-allied or US-sympathetic and match or exceed their weight class. There's also North Korea of course, but it's not like Kim Jong Un has any serious power projection outside the Korean Peninsular. Realistically, NK serves only one function in a potential conflict US-China conflict, which is to encourage South Korean neutrality and force the US to keep an eye on the region.
All of which is to say - given the above, I will be very surprised if China makes a move on Taiwan in the next decade, and if it does, I expect it to be a painful defeat for China, even if not a quick one. So I think a lot of the China panic is emotionally premature, even if it's good for the US to start thinking now about The View From 2030, so to speak.