For starters, not orchestrating the 2014 coup, not shelling the Donbas on Feb 16 2021, not violating the Minsk agreement would have helped. The laws Ukraine passed that made Russian speaking Ukrainians second class citizens were also egregious. Keeping promises that assured Russia NATO wouldn't encroach would be useful.
I don't know if this situation can be resolved with the current administration. I think it will take new leadership to negotiate away from the brink. I'd like to see RFK in there even if he had a chance.