The leadership in Ukraine could have prevented the war through reasonable negotiations. The two most prominent issues are Crimea and northeast Ukraine (Donetsk and Luhansk).
Crimea was a part of Russia before Ukraine became independent. Now that Ukraine is no longer part of Russia, it does not have the right to claim that Crimea is its territory. It is somewhat similar to the Northern Ireland situation. The only time that Northern Ireland was part of the Republic of Ireland was when the entire island of Ireland was part of the U.K. When the Republic of Ireland withdrew from the U.K., it did not have the right to take Northern Ireland with it.
In northeast Ukraine, Russians populate most of the area. It is somewhat similar to that of Quebec in Canada. The French, who populate most of the region, want to practice their own culture and are given a lot of autonomy. Allowing these freedoms prevents conflict. Over 10,000 people have been killed in northeast Ukraine since 2014. It was not a sustainable situation and it caused the recent war to break out. More autonomy should have been granted to Russians that live in northeast Ukraine.