We only know this because it is the impression that has been given. The only reason we 'know' that Russia is willing to go to war/nukes over Ukraine is because that is the impression Putin has been giving.
Its too late to change that now, but the West needs to be crystal clear in its response to any further incursions (eg rumours about Russia pushing into Moldova).
Other general thoughts and musings/armchair strategies;
1) NATO enact a no-fly zone around Western and Northern Ukraine. Putin has publicly denied that this is an invasion of Ukraine multiple times. He has claimed it is a "special military operation" focused on Donbass Region. With that in mind, there should be no reason to object to this plan, assuming it doesnt interfere with that region.
In practice, this would have one of two results; force Russia/Putin to call this what it is - a full scale invasion. Or alternately, to deny the Russian Air Force supremacy over Northern/Western Ukraine, which would give the Ukrainians a far better fighting chance of repelling attackers.
2) Ukrainian insurgency. I suspect this is already in the plan, but Ukraine is not a small country. It has 44m people. If Russia wants to occupy and hold that territory, make it impossible for them. If he installs a puppet government, make it impossible for them to function. Practically speaking, I believe this is the most likely longer term scenario in the region - I only fear that Russian genocides and mass-incarcerations will follow.
3) Topple Putin. We are seeing protests across Russia, and sanctions targeting his inner circle and oligarchs. Loosing Putin's grip on Russia and the bigger picture changes rapidly.
4) Putin might claim he is willing to deploy nukes over whatever the flavour of the month is, but are we really to believe that he would be able to go through with it? That not a single general or senior official will reflect and think that Mutually Assured Destruction is a poor choice, and stop him?