If you are thinking either tactically or especially strategically about something, you have to consider multiple outcomes of every action you take. If you do X, what are the potential outcomes? Which of those outcomes is particularly catastrophic, and are there factors that can remove those catastrophic outcomes?
You absolutely cannot "wing it" or go with your gut.
Unless you're Donald Trump and the gaggle of sycophants and fools that constitute his inner (and outer) circle.
The goal - such as it is - was apparently regime change. The best opportunity for that was when the people of Iran were being gunned down in the streets in early January. Even then, it was primarily wishful thinking, even magical thinking. The ease of Venezuela clearly influenced Trump, as did the need to reassert dominance domestically and internationally.
The result, so far, has been pretty catastrophic. Apparently, no one really expected Iran to do the thing that we all knew Iran would do: throttle oil supplies. For someone so locked into the world view of the 1970s, Trump's ignorance on this is striking.
To be clear, this is not about national security. Iran did not pose an immediate threat to the US. We've been mostly containing them for half a century. By threatening regime change, we've removed any constraints on Iranian behavior, as this is an existential conflict for them. Yet, apparently, we went into a war with our goals - regime change on the cheap - completely inadequate to the ability to influence events in Iran.
The final expression of just how unbelievably fucked up the "thinking" is on Iran is this: We are letting Iran export oil and reducing sanctions. We are bombing their country, but we absolutely cannot allow them to stop selling oil to China or China might fuck with us and our plate is kinda full right now. Allowing Iran to sell their oil - hell, allowing Russia to sell their oil - is not in America's national security interest. When you are in a conflict - directly or indirectly in Russia's case - you throttle their economy. You have a PLAN to throttle their economy.
In World War II, America flew a dangerous and costly mission to bomb the oil facilities in Ploesti, Romania. It was the primary oil facility in Nazi occupied Europe, and it was critical that we use oil as a weapon to deprive their military of a critical resource. Today, we are letting Iranian and Russian oil on the market because Trump knows that rising oil prices are politically perilous for him. The war started out unpopular and it will only get more unpopular as the cost of the war and the price of oil soars ever upwards.
Turns out having imbeciles running your government is a bad idea.