It’s not an excuse to invade another country. To take the first steps and initiate an invasion isn’t right.
If the west / NATO / EU hadn’t entertain the notion of the Ukraine joining their ranks, I don’t believe Russia would have invaded. The relatively peaceful situation would have continued. As it is, a war has now started. Who knows where it will end?
As long as Ukraine remained a compliant stooge of the Russian superstate, it was safe from invasion. But going back to 2010 , or even a little earlier, Ukraine themselves started looking Westward. The then ruling Party had as it's election manifesto that it would sign up a trade deal with the EU. This was OK with the electorate and they got voted in on foot of this proposal. Then just before the deal was to be signed off on with the EU , Putins instruction came down ... Nyet. That caused 95 days of increasingly violent disturbances in Kviv, in which about 200 plus people were killed by the Riot police ... Using the term riot police is a misnomer, they included irregular forces released from prison for violence and given batons.
Anyway by then the Russian leaning President scarpered to Moscow in a midnight flit. New elections were held and a new government elected and a new President.
The new Government was niave but was popular , and there was euphoria ,and signed off on the EU deal, which allowed Ukraine to have limited access to the West. This is the formative period in Ukrainian self reliance.
Moscow was not best pleased , especially because Crimea was a favoured holiday spot and retirement location for the elite and of course the home of their Mediterranean Fleet. So they organised a coup. They inflitrated thousands of little green men,and suddenly declared UDI and joining up with Russia. It was fait accompli before the Ukrainians even realised. Since Crimea was very Russian centric anyway, the referendum passed .
This was not enough for Putin so he attempted the same game in two other border regions ... The Donbass. However the Ukrainians were wiser to to ploy now. And resisted. But Donbass is easier to supply from Russia and the Ukrainian army was pathetically weak, .. but none the less they basically held the line. Putins idea was as Flecc has identified to make a land corridor from Russia to Crimea and Mariupol was in the way. Very strong resistance by a volunteer militia in that city broke the Russian advance, and they withdrew. This is the origin of calling Ukrainians Nazis .
An uneasy ceasefire Sporadic violence has continued for the 8 years since.
Meanwhile Ukraine didn't waste the time and solicited Western Support and training and increased their westernisation. Note it was what the Ukrainians wanted ... The rest is current news . Putin's levelling of Mariupol is sheer revenge and grudge.