Well first, if they didn't want this conflict in the first place, they should've opened negotiations and listened to Russia's demands, instead of engaging in this brinksmanship, and we all saw how that played out. Biden and Zelensky should've came to the negotiation table at the very least. Some of Russia's demands were probably a no-go, but for many of the demands, a reasonable compromise could've been worked out that alleviated the threat to Putin of NATO encroachment upon Russia's vital security interests and sphere of influence.
Since that didn't happen, Ukraine should've at least kept the option of peace talks open, instead of breaking them off, rebuffing Russian overtures for negotiations, and outright stating that talks weren't an option. If peace talks were to occur at some later stage, it would include Zelensky and Putin meeting face to face and inking out an agreement that would prevent Ukraine's ascension to NATO, the shipment/sales of heavy NATO equipment to Ukraine, POW exchanges, and the return to pre-February borders.