For example had NATO countries all offered 50% of their GDP for the next decade as gifts to Russia in return for Putin calling all his troops out of Ukraine, it's very likely he would have ended the war on day two.
Of course, that's not an offer NATO countries would have been willing to make (and even if they had made a deal like that, at a price less ridiculously high than 50% of GDP, it could easily lead to Russia starting the exact same war a decade later, now with much better funding).
I'm not suggesting the above as a serious "this should have been the way to deal with it", just as a random, over-exaggerated example that there are diplomatic options above and beyond preventing wars that stem from miscommunication / misunderstandings.