rouhani
Iranian President Hassan Rouhani at Bushehr nuclear power (Jan 2015)
Some (not so) smart people believe that the implementation of the Iranian nuclear deal shows that "sanctions worked":
Doug Saunders @DougSaunders
The Iran paradox: this week proved that sanctions worked. So it was the worst week for US Congress to impose new sanctions
10:42 AM - 17 Jan 2016
This is completely wrong. Sanctions did not work in the case of the nuclear issue with Iran. Sanctions will also not work one Iran's ballistic missile program.

Other authors have already expanded on this in length but it needs repeating.

For Iran the development of a civil nuclear program for electricity and other needs was and is seen as a precondition to become a fully developed modern state. The U.S. and Israel wanted to prevent that. Israel sees Iran as a competing power in the Middle East and the U.S. sees Iran as too independent and too powerful to be left alone. Both want to restrict Iran's development unless Iran agrees to again become the client state it once was.

The vehicle to pressure Iran was its nuclear program and an assertion that "Iran has no right to enrich" Uranium. That assertion was wrong as a legal argument as any state has a natural right to use its resources as it likes, but the U.S. went to great length to make that claim. If it would have gotten its way it would have achieved a veto over how Iran, and others, could manage and use its natural resources.

It was that U.S. claim and Iran's will to resist it that prolonged the conflict over a decade. After first (false) claims were made that Iran was developing nuclear weapons, negotiations ensued and made fast progress. Iran was willing to restrict its activities and to have its nuclear program under full inspection. But its was the U.S. "no right to enrichment" point that blocked any solution. Writes UK negotiator Peter Jenkins:
Having served on the UK's Iran Nuclear negotiating team in 2004 and 2005, I know that in March 2005 President Hassan Rouhani and Minister Javad Zarif, then in different roles, were ready to offer a deal very similar in its essentials to the JCPOA.
At that time Iran had only a few experimental centrifuges and little enriched Uranium.

But the U.S. insisted that Iran had no right to enrichment and blew the negotiations. Sanctions followed and Iran responded by building up more enrichment capabilities. Several more sanction rounds followed and Iran responded to each round by again increasing its capabilities. After the last round of sanction Iran announced that it would create highly enriched Uranium to fuel nuclear submarines.

At that point the U.S. finally understood that it was senseless and impossible to ever increase international sanctions as a way to stop Iran's nuclear program. Only two alternatives were left. A very aggressive and expensive military attack on Iran followed by a lengthy occupation for which the U.S. public had zero appetite or negotiations and concessions to settle the issue.

A new negotiation round started in November 2013 and at the core of the issue was again Iran's right to enrich:
Disagreement over whether Iran has the right under international law to enrich uranium goes to the heart of the decade-old dispute over its nuclear program and has complicated diplomacy to end the standoff.

Iranian officials made clear on the third day of talks in Geneva on Friday that the Islamic state's "right" to enrich uranium must be part of any interim deal aimed at curbing its atomic activity in exchange for some sanctions relief.
...
The United States says no country has that explicit right under the Non-Proliferation Treaty (NPT), the 1970 global pact designed to prevent the spread of atomic bombs.
During those negotiations in 2013 the U.S. finally caved and a few days later an preliminary agreement was reached:
The initial nuclear deal struck with Iran at the weekend states unambiguously that the second step - or "comprehensive solution" - will "involve a mutually defined enrichment program with practical limits."

The wording allows Tehran to state that the U.S. and five other powers in the negotiations have conceded that a final agreement, due within six months, will leave Iran with a domestic uranium-enrichment program.
Iran interpreted that as the acknowledgement of its right to Uranium enrichment. After this key issue was solved further negotiations were about give-and-take points but no longer about a fundamental disagreement.

As was revealed only later the U.S. had given up on the "no right to enrichment" claim even before the November 2013 negotiations:
The secret US-Iran diplomatic channel that helped advance the interim nuclear deal last year got underway after a message from US President Barack Obama was conveyed to Iran: The United States would be prepared to accept a limited Iranian domestic enrichment program as part of a nuclear agreement in which Iran would take concrete and verifiable steps to assure the world its nuclear program would remain exclusively peaceful.
...
Obama's message that he would be prepared to accept a limited Iranian enrichment program in an otherwise acceptable deal was conveyed to Iran at a secret meeting in Oman in March 2013, by a US delegation led by Deputy Secretary of State Bill Burns, which also included Jake Sullivan, now Vice President Joe Biden's national security adviser, as well as Einhorn and then-White House Iran adviser Puneet Talwar.
It was the U.S. that caved and pulled back from its (indefensible) position that Iran was not allowed to enrich Uranium. It was this concession by the U.S. - not the sanctions - that brought Iran to the table and which allowed to end the conflict over Iran's nuclear program.