In 1979, an arms embargo was enacted on Iran, following the Iranian revolution and the Iran hostage crisis, where 52 American diplomats and citizens were held captive by a group of Iranian students who overthrew the U.S. Embassy in Tehran.
Later, in an operation to free the seven American hostages in Lebanon, Israel was supposed to send weapons to Iran despite their embargo. The US would then resupply Israel and receive the Israeli payment. The Iranians said they'd do anything in their power to free the hostages (in Lebanon, not to be confused with the Iran Hostage Crisis).
Instead, Lieutenant Colonel Oliver North made many modifications to the plan. He let a portion of the proceed sales from the exchange go to the Contra in Nicaragua.
In Nicaragua, there was a dictatorship ruled by the Somoza family from 1936 to 1979, called the Somoza dictatorship. After increased contempt by the citizens of Nicaragua, they decided to revolt. In 1978-1979, the Sandinista National Liberation Front (FSLN) violently ousted the government. The Sandinistas were communist, and thus were not supported by the US government. The Contra, rightists were against the Sandinistas, and fought a lengthy war with them.
The main controversy was that Oliver North used government money secretly and helped the Contra forces (specifically prohibited under the Boland Amendment). John Poindexter was also involved, and he was convicted of five counts of lying to Congress. Ronald Reagan was not connected to the scandal, and he said he had no idea those events were going on.