After defeating Ghirahim's final form, you can save the game at the bird statue, and you can return to the present time using the Gate of Time to prepare. Then go back to the past and go to the bottom of the pit to enter the dark circle and begin the final battle.
In the first phase of the battle, your objective is to avoid letting Demise hit you, then hit him when he's vulnerable. Unfortunately, he isn't vulnerable very often. Block his attacks by using shield bashes, and hit him if he delays long enough between his attacks. Be prepared to do multiple shield bashes in a row if necessary. Sometimes when he reaches back with his sword, it may be long enough for you to hit him. Also, try attacking his legs.
In the second phase of battle, Demise will charge up his sword with lightning. He can shoot energy at you, but this can't be blocked with the shield, so do a side jump (which might not keep you safe from the horizontal energy) or run to the side to get out of the way.
Don't try to hit him with your sword or you will get electrocuted. Instead, do a shield bash when he attacks. He will do three attacks in a row, and if you block all three, he will be knocked off balance. Hit him repeatedly when this happens.
When Demise lifts his sword up to get a recharge, you might have time to raise your own sword and charge it up with lightning as well. You can then hit Demise with this energy to stun him. Then quickly run up to him and hit him repeatedly.
When Demise falls to the ground, you won't have enough time for a finishing blow the first time, so repeat the above strategy to knock him down again. You have to be VERY quick with the fatal blow the second time you knock him down, or he will recover before you can do it. Each time you knock him down, you get a longer window of opportunity to execute the fatal blow. Once you succeed, he dies.
Be sure to watch the whole ending. You can play the harp during the ending. After "The End" appears on the screen, wait for a while and then press any button. You will be asked if you want to save over your save data to try Hero Mode. In hero mode, the game is much harder:
- Enemies have twice as much health
- Enemies deal twice as much damage
- Recovery hearts do not appear unless you are carrying a Heart Medal
- When you get the master sword, charging your sword for a skyward strike is no longer delayed. It charges up instantly.
- You start with all the bugs and treasures that you had before beating the game, which helps you get upgrades early on.