There is no stopping a war once it has begun, other than victory for one side or the other. It simply doesn't matter how or why the US went to war with Iran anymore. It happened. That is the reality; will leave it to Historians to tell us 'why'.
Living in the present, the ball moving forward, efforts must be made to either accept defeat quickly, or make decisive moves toward victory.
Taking the second option will include boots on the ground. There is no need to count your chickens before they hatch—nobody can predict how many lives must be offered on the altar of anti-Islamic totalitarianism and human rights (if these are goals worth pursuing, which isn't the point, militarily).
Likely a slow and methodical push across the Iraqi-Iranian border with joint-Allied Western troops, trained in the tactical necessities thry have chosen to undergo (not sending in peasant cannon-fodder), and sizing vast territory by use of force while arming and supply Iranian dissidents with means to defend themselves and become strategic partners in the cause of their own potential freedom, is a thoughtful approach.
The outcome is impossible to predict, as similar allied efforts on the other side could coalesce as well, though at current outset seems unlikely as there is little to actually gain by extending the power of a failed and unpopular Messianic cult of extremists who only ever cause trouble and create conditions worthy of constant pushback by trading partners.