Ukraine got into a war because Russia invaded them, demanding they give up independence.
The only way for Ukraine to not go into war was bowing down to Putin and forfeiting freedom.
As Clausewitz said, “The aggressor is always peace-loving… he would prefer to take over our country unopposed.”