It would depend on how well planned the war was. Our objectives. Our exit strategy. And how popular the war was at home. We are the strongest nation in the history of the world militarily. Today we spend more on weapons and military than the whole rest of the world combined. But we can't win against little 4th rate countries like Afghanistan and Iraq because we went into both those wars without proper planning, no clear objectives, etc. There's no reason we could expect to do better against Iran, a larger, stronger, richer country than the two in which we're failing now.
Iran wisely decided to spend its money on defensive weapons rather than offensive ones. So they were so well defended that even GW Bush couldn't bomb them. He desperately wanted to, not for any military or security reason but for his own political purposes. But he couldn't so instead he just 'talked tough' about them. Iran has neither the intention nor the capability to make trouble for any of their neighbors--including (in fact -especially-) Israel. All they can do is talk tough too. So our 'war' with Iran so far is just words, and it's not very likely to go beyond that.
In particular, Iran has cruise missiles made by the Soviets that some experts think could sink a US aircraft carrier. These missiles are similar to the French Exocet missiles used by Argentina against the British in the Falklands War. Argentina had five of these missiles which cost about $1 million apiece, and they were able to inflict billions of dollars worth of losses on British warships. They are supersonic cruise missiles that fly just above the surface of the water, and they are almost impossible to defend against. Some experts think they could sink US warships. Even if not, at the very least they could sink a few supertankers in the Straits of Hormuz, sealing off the straits and cutting off the entire supply of oil from the Middle East.
If we had a good reason to go after Iran, like if they attacked us first (don't hold your breath), it might be different. Like after Pearl Harbor, everyone from 17 to 30 would drop what they were doing and go line up at recruiters. People would be willing to make sacrifices and put up with inconveniences for the duration. Our military would grow in size, and after some training we might have enough troops to actually pacify and stabilize a country the size of Iran.
But that's not how we fight wars these days. These days the president decides just on his own to send troops. The people are told that this will be a short, cheap war and will not inconvenience them in any way. The real purpose of the war is never really spelled out, and even at high levels the objectives are unclear. We usually put some corrupt boob in charge and support him as if he were a legitimately elected leader. We end up, as we have in Afghanistan and Iraq, fighting a losing battle that we can't win and can't quit. Iran could be the mother of all 'quagmire' wars.