That's why Obama proposed a deal where the US would do things and Iran would do some other things. Kinda like how I give the supermarket money and they give me icecream. I don't have a right to take their icecream away, but we can trade for it.
Trumps idea was to say "no, we will not make any deals, because Obama touched it and now it smells". Then he noticed that Iran wasn't following the deal, panic, and start bombing.