Have to go back a bit farther in history. NATO was an alliance to defend against the expansionist USSR. When the USSR collapsed NATO wasn't needed anymore;. When the somewhat expansionist Serbs fomented separationist rebellions in other parts of the former Yugoslavia, NATO came back to life to stop the Serbs.
But then NATO decided to support the stirring up of Albanian-supported rebellion in part of Serbia and helped invade and seize part of what was Serbia. Choosing sides in a breakup is something that Serbs and Russians remember and they end up doing the same thing themselves.
The way to stop this is to stop NATO in 1999. Stop Clinton's wag-the-dog and Albright's ancient grievances against the Serbs. Since it's too late for that, the way to do it is to stop NATO again now. Of course you'll do otherwise and Russia may be pushed out. If they are, then mark your calendar for 20 years from now for war with Russia, because they won't stay down. Sooner if they get Chinese support against the US.
Alternatively Russia will keep a chunk of Ukraine but conflict will continue at some low level. Or Russia will be allowed into negotiations for an independent demilitarized status for parts of Ukraine, maybe all of Ukraine. I don't think such an enlightened solution is likely.
Dont try to rationalize
You stated that if Mexico did what Ukraine did we would invade.
Ukraine never did what you claimed.