Here's a concise overview of the possible endings (some permanent, others not) of the Russo-Ukranian War, as well as the actors involved and their intentions.
The main actors are Russia and Ukraine. The secondary actors, without which the war could not continue in this capacity are: China, North Korea and Iran for Russia and the US and Europe for Ukraine. Not counting the many neutral countries profiting from the war indirectly.
Politically, Ukraine wants to integrate with the West and be a democratic, economically developed country. In terms of war goals, Ukraine wants all of its occupied territory back in its internationally recognized borders (that includes Crimea).
Politically, Russia wants its status of a global power back, along with its imperial sphere of influence, which roughly encompasses the territory of the former USSR, thus rectifying the "greatest political catastrophe of the 20th century", as Putin defined the fall of the USSR.
Russia has intentionally left its war goals undefined, but from Putin's ultimatums and the formal, by Russian law, annexation of Ukrainian regions in the east and the south, its goals do include grabbing Ukrainian territory (which it doesn't entirely control), but that's not all.
Judging by the previous Minsk Agreements, Russia's goal in Ukraine was not only territorial expansion, but also political control over Ukraine. The Minsk Agreements attempted to impose a de facto division of Ukraine through federalization, effectively giving Russia veto powers.
There are two permanent peace solutions for the war:
1. Arming Ukraine in such a fashion as to enable it to expel Russian soldiers from its territory;
2. Freezing the war on the current frontlines, while providing Ukraine with security guarantees (NATO best, bilateral fine).
Without giving Ukraine sound security guarantees, not assurances like in the Budapest Memorandum, the war may be paused, but nothing will stop Russia from renewing it later on. After all, Russia paused the war in 2015 and renewed it in 2022.
While the aforementioned secondary actors enable the war for both countries involved, Russia hasn't expressed any sincere intentions of accepting a Ukraine integrated with the West on its borders, even if the hostilities were to be stopped along the current frontlines.
What it boils down to is not territory then, although the conquered territory is a tangible spoil of war that Putin can show to the Russian society and its elites. The essence is whether Russia gets to control Ukraine politically or not, that's what this war is about.
Ukraine would accept the freezing of the war on the current frontlines, although it would not formally agree to change its internationally recognized borders, but what it won't do is give up its political sovereignty in favor of Russia, that is actually a red line.
The only logical way for the war to end is for the West to provide Ukraine with security guarantees, ideally a membership in NATO (with clear stipulations on what territory its guarantees apply to), or providing bilateral guarantees to Ukraine with unchanged contents.
Any other freezing of the war, without guarantees, would simply mimic the Minsk Agreements and would be an introduction to the new war a few years down the line.
Of course, the West can simply throw Ukraine under the bus, this is Trump's plan. Give Russia political control over Ukraine, not integrate it with the West, agree to the Russian sphere of influence in Europe. The war can also end this way. Then countries like Moldova are next.
For the time being, the West hasn't made a final decision on its strategy. It prolongs the Ukrainian resistance, but hasn't crystallized the political will to stand behind it to end the war (Russia won't go to war with NATO, that's why its troops are in
and not the Baltics).