It is one of those sadly impossible threads.
Israel has and had no choice but to defeat enemies - as in every war since independence - because they know that if it ever comes even close to losing - to the formation of a new state of Palestine where Israel currently is (e.g. a new country with majority Muslim population), then the current population of Israel (80% Jewish, 20% Muslim+Christian+other - side note that minorities who accept state of Israel have Arabic as formal language, and more rights than anywhere else in ME - including freedom of expression and all sexual and identity rights. You have arab-israeli chief lord justices, generals etc etc) will be eradicated.
A population with a history of attempts at its eradication, outnumbered 10 to 1, on a tiny strip of land which is the only place they call home - is quite obviously stuck in an impossible position and will not cave in.
It seems very difficult for all those chanting "River to sea" to understand this point - Palestine instead of Israel will be a massacre of the entire population of Israel - 7th October reminded the Israeli population of this.
And Israel knows this and behave accordingly - there will be civilian deaths in Gaza as they try to end Hamas. Hamas buries itself amongst civilians and builds it's infrastructure within civilian areas.
If there was no Hamas, there would be no conflict right now.
Probably the only practical solution I've ever seen was that suggested by an Israeli billionaire - build industrial areas with jobs (akin to Marshall plan). His point was that once people have jobs, they have meaning, and suddenly the wanting to be terrorists falls away.
It is tragic.