"The 'end'" is your military objective; when you achieve that objective, then you know when the 'end' has come. The Revolutionary War came to an end when the British ceased their aggressions and pulled back, leaving the Colonists to themselves. The Civil War came to an end when everyone decided they had had enough of the killing and settled the underlying questions. World War II ended when the various Axis factions decided they were not going to achieve their objectives.
Part of the problem with the Korean and Vietnam "wars" was there was no clear objective. Indeed, at least one if not both of those bruhahas were characterized as "police actions", not "war", so we as a country found ourselves ensnared in a tar baby with no way out.
Our military objective is for Muslim terrorists to quit attacking us, or trying to.
One effective way to accomplish this would be to kill every Muslim in the world. No Muslims, no Muslim terrorists. Obviously, we aren’t going to do that, not because we aren’t capable of doing so, but because we are unwilling (Thank God!) to be the type of people who would do such a thing.
Short of that, it becomes really difficult to figure out a strategy that will achieve the objective, at least using methods we’re willing to use. In fact, I don’t think there is any such strategy.
Since the objective cannot be accomplished, we default to trying to minimize attacks on us. When you can’t win, you try to reduce the damage.