If you're referring to the Iran Contra Affair, here's an explanation from Wikipedia
The Iran–Contra affair[1] (Persian: ماجرای مکفارلین, Spanish: caso Irán-contras) was a political scandal in the United States which came to light in November 1986, during the Reagan administration, in which senior U.S. figures, including President Ronald Reagan, agreed to facilitate the sale of arms to Iran, the subject of an arms embargo.[2] At least some U.S. officials also hoped that the arms sales would secure the release of hostages and allow U.S. intelligence agencies to fund Nicaraguan contras.
The affair began as an operation to improve U.S.-Iranian relations. It was planned that Israel would ship weapons to a relatively moderate, politically influential group of Iranians, and then that the U.S. would then resupply Israel and receive the Israeli payment. The Iranian recipients promised to do everything in their power to achieve the release of six U.S. hostages, who were being held by the Lebanese Shia Islamist group Hezbollah, who were unknowingly connected to the Army of the Guardians of the Islamic Revolution. The plan eventually deteriorated into an arms-for-hostages scheme, in which members of the executive branch sold weapons to Iran in exchange for the release of the American hostages.[3][4] Large modifications to the plan were devised by Lieutenant Colonel Oliver North of the National Security Council in late 1985, in which a portion of the proceeds from the weapon sales was diverted to fund anti-Sandinista and anti-communist rebels, or Contras, in Nicaragua.[5]
While President Ronald Reagan was a supporter of the Contra cause,[6] no conclusive evidence has been found showing that he authorized the diversion of the money raised by the Iranian arms sales to the Contras.[3][4][7] Handwritten notes taken by Defense Secretary Casper Weinberger indicate that Reagan was aware of potential hostages transfers with Iran, as well as the sale of Hawk and TOW missiles to "moderates elements" within that country.[8] Oliver North, one of the central figures in the affair, wrote in a book that "Ronald Reagan knew of and approved a great deal of what went on with both the Iranian initiative and private efforts on behalf of the contras and he received regular, detailed briefings on both." Mr. North also writes: "I have no doubt that he was told about the use of residuals for the contras, and that he approved it. Enthusiastically."[9] North's account is difficult to verify because of the secrecy that still surrounds the affair.
After the weapon sales were revealed in November 1986, Reagan appeared on national television and stated that the weapons transfers had indeed occurred, but that the United States did not trade arms for hostages.[10] To this day, it is unclear exactly what Reagan knew and when, and whether the arms sales were motivated by his desire to save the U.S. hostages. Notes taken December 7, 1985, by Defense Secretary Weinberger record that Reagan said that "he could answer charges of illegality but he couldnt answer charge [sic] that 'big strong President Reagan passed up a chance to free hostages.'"[11] Investigations were compounded when large volumes of documents relating to the scandal were destroyed or withheld from investigators by Reagan administration officials.[12] On March 4, 1987, Reagan returned to the airwaves in a nationally televised address, taking full responsibility for any actions that he was unaware of, and admitting that "what began as a strategic opening to Iran deteriorated, in its implementation, into trading arms for hostages."[13]
Several investigations ensued, including those by the United States Congress and the three-man, Reagan-appointed Tower Commission. Neither found any evidence that President Reagan himself knew of the extent of the multiple programs.[3][4][7] In the end, fourteen administration officials were indicted, including then-Secretary of Defense Caspar Weinberger. Eleven convictions resulted, some of which were vacated on appeal.[14] The rest of those indicted or convicted were all pardoned in the final days of the George H. W. Bush presidency; Bush had been vice-president at the time of the affair.[15]