A lot of this depends entirely on what kind of war we’re talking about. Russia or China attacking the United States would be complete and utter suicide. Russia’s long range power projection capabilities are aging and vulnerable. They have some more modern air power, but nothing that would enable them to survive long in any sort of encounter with the US military and we’d see them moving toward us weeks in advance. China’s navy is an interdiction fleet with modest power projection more suited to punishing third world nations that fail to honor Chinese contracts (aimed squarely at sub-Saharan Africa).
A fight over neutral territory (e.g. Turkey) would go much the same way. Russia would likely do a little better than China there, but US forces would obliterate what air assets they have, leaving their ground forces vulnerable. No direct conflict goes well there for either of them.
Where things get more interesting is a confrontation at or within their respective borders. Defeating either of them would require a massive build-up of US forces. They would see it coming and prime everything they’ve got to resist. They’ve been preparing for just this sort of conflict for decades, and both of them have a significant amount of hardware and manpower to throw at home defense. We would beat either of them, eventually, but it would take a long time (several years at least), burn through massive amounts of equipment and personnel, and risk all-out nuclear war.
Power projection is just plain difficult to do. It took a while for us to build up just for an invasion of Iraq. That was done with plenty of regional support, including bases and land that were accessible to us and relatively safe, all against a military that was much smaller and equipped with older, less effective weapons. China and Russia are vastly better equipped and we would have to be fully committed - as a nation - to sustain the kinds of losses we’re not used to seeing in order to achieve the sort of victory Americans expect.
Neutron bomb.