Ukraine's former president, Viktor Yanukovych, wanted closer ties to Russia and many Ukrainians didn't and others in towns close to Russia, didn't. Pro-Ukrainians forced Yanukovych out of office, and he fled to Russia. Once rid of Yanukovych, the Ukrainian's voted in Zelensky. Russia, seeing a loss of an ally government and a nation getting closer to the west and the European Union, amassed troops on Ukraine's border. Putin didn't want NATO forces next to Russia in that region, so he attacked, figuring that it would only take a few weeks to overcome Ukraine and restore Yanukovych to his presidency. He guessed wrong about the combination of Ukraine resistance and the EU and US helping it.
Put yourself in the Ukrainian's place. You have three choices:
1. Surrender and allow Yanukovych back in and Russia to take over.
2. All Ukrainians that don't want to be basically ruled by a Russian Oligarchy.
3. Fight and hope to win.
What's your pick, or do you have some other, novel solution?