A man from the desert, the King of the Gerudo, named Ganondorf Dragmire, started searching for the secrets to where the Triforce lays. To break the seal of Rauru he found out he needs 3 stones and an Ocarina.
Each of these items was held by a differant race in Hyrule. One was held by the Kokari, the Kokari Emerald. To try to force them to give it up, he poisened the Great Deku Tree. Who is a guardian spirit in the forest. He tried to starve and frighten the Goron's out of the Goron Ruby. He put monsters inside of thier feeding grounds. And for the Zoras he cursed Lord Jabu-Jabu. A religious icon of the Zora, he did this to get the Zora Sapphire. The final piece of the lock is the Ocarina of Time, held by a member of the Royal Family, Ganondorf was not sure. He devised a plan to go to the castle to find out which one had it.
Meanwhile, Link was called to the Great Deku Tree. The Great Deku Tree explained about his curse. Link tried to save the Deku Tree, but once the curse was broken, the tree was almost gone. Before his untimely death, The Great Deku Tree, gave Link the Kokari Emerald and sent Link off to the castle to meet the princess. Though the Kokari were always told they would die if they left the forest, the Great Deku Tree, told Link the stories were false. Link, then uncertain of what would happen set of to Hyrule Castle with his new companion Navi. A faerie who was told by the Great Deku Tree to accompany Link on his quest.
Link, when he was meeting with the princess, Ganondorf was meeting with the King. The Princess Zelda told Link of her dreams and how the way for them to save Hyrule was to get the spiritual stones before Ganondorf.
Link set out to the homes of the other two holders of the spiritual stones, the Gorons and the Zoras, and courageously cured their problems. Link then set back to the castle to tell the princess, but it was too late. Link's dream became a reality. Zelda and her nursemaid Impa were being chased by Ganondorf. One part that he didn't see in his dream though, the Ocarina of Time. Zelda threw the Ocarina so that Link could retrieve it and stop Ganondorf.
Once Link retrieved the Ocarina he went to the Temple of Time. When Link picked up the Ocarina, Zelda sent him a message teaching him the sacred song to open the door. The Song of Time. When Link played this song on the Ocarina it opened the seal created by Rauru.
Inside was the legendary Master Sword. Link went inside and picked up the sword. Once he did it took Link seven years into the future. But, little did he know, Ganondorf tricked Link. Suspecting he had the keys to the scared realm, he followed him into the Temple of Time, and then went into the sacred realm after Link picked up the Master Sword.