Time favours Ukraine. Absent a really shocking reversal in all western aid, they're surviving and advancing. Russia, meanwhile, is incurring deep structural damage to its economy that shows up already as huge labour shortages, high inflation, and high interest rates, along with war-driven destruction of infrastructure. It's steadily marching to a point where economic collapse, internal unrest, or both, demand that Russia withdraw from Ukraine.
Putin either doesn't know or doesn't care that they're not winning, and any replacement for Putin will be Putin*2, so it'll take something societally catastrophic to force the issue, which becomes more likely every day. As long as Ukraine just hangs on, they win by not losing.
I don't know that it can end from anything short of that.