All wars will inevitably come to an end, regardless of their duration.
They may conclude with one side achieving a clear victory, allowing them to impose their terms, or via negotiations in which both sides compromise because neither can achieve a decisive victory.
These two outcomes are well-documented throughout history. Most wars, from the ancient world to World War II, ended with a clear victory for one side over the other.
However, no definitive victory has ended any major war since 1945, even when the balance of power was heavily skewed in favour of one side, as was the case in the conflicts between the United States and the Soviet Union in Korea, Vietnam, and Afghanistan.
These wars, along with others, ended through negotiations that began after the fighting ceased. While one side may have held a stronger position in some of these talks, they did not always achieve all their goals. The negotiation process was complex, and its outcome was influenced by a variety of factors, not just the military situation on the ground.
An end to the war in Ukraine will inevitably be brought about through negotiations. The sooner this can be achieved, the better for everyone. Talks will need to establish common ground based on a realistic vision and motivated by shared interests.