In OoT, when link is sent back to his childhood , he warns zelda about ganondorf which leads to him being sentenced to execution.
The sages try to exectue him but it turns out that ganondorf is too powerful (something, something demise) for them to kill and he ends up killing one of them himself, at which point they seal him in the twilight realm out of desperation.
He seduces Zant, pretending to be a god or something and facilitates his escape from the twilight realm after which link kills him.
This is pretty much all explained in the game unlike most things so it's laid out pretty flat for you.
Also after being sent back in time, link dies in regret of the fact that he was never remembered as a hero and you get the undead guy that teaches you sword moves.
That's probably the coolest part about TP's connection to OoT, nintendo really don't like the hero of time link.