To defeat Ganondorf, have your sword out and then approach him. Wait for him to hold his sword out to the side a little differently, so that you know he's going to attack. Run away in a straight line from him, and when he charges at you, an image will appear quickly for the "A" button, saying: "Chance." When this happens, L-Target him, and press A to go into a sword lock with his sword. Keep pressing A rapidly until you force him off. Re-lock on by doing the L-Target, and keep pressing "A" every time it says "Attack" next to the regular "A" button image at the top right of the screen. That way you will not lose the "lock on" status. It is very important not to lose it, because you must bash him down constantly. Eventually Ganondorf will go down, and it will change to "Finish." Press "A" again and Link will finish him off, and the ending sequence will play out. You can not save again after this, so make sure you have a save point close to the end if you want to do it again. Even so, you will start back at Hyrule Castle.