Jimmy Carter tried to rescue the hostages, but the steps he took did not work.
He tried the diplomatic options, but Iran's leaders, especially the Ayatollah Khomeini, refused to listen to the West or to organizations such as the UN, which were seen to be western.
The rescue mission failed because it was too complex and relied too much on luck. Also, he did not authorize enough helicopters to be used. The reason the mission was aborted was because there were not enough helicopters to continue.
He also made too big a deal out of it, such as refusing to leave the White House until the hostages were freed and not lighting the National Christmas Tree. That played right into Iran's hands and gave them all kinds of power over the United States.
The hostages were released on January 20, 1981, half an hour after Ronald Reagan had been sworn in as president. But they probably would have been released sooner if Carter had downplayed the situation in public and said to Iran 'We're not talking until you release our hostages.'