After you battle Agahnim in Hyrule Castle, you are dragged into the Dark World.
Receive a Message
When you arrive atop the pyramid in the Dark World after your battle with Agahnim, Sahasrahla will tell you to rescue the seven maidens in the dungeons throughout the Dark World. The first dungeon will be marked on your map, which you can press X to view.
Optional: Get the Moon Pearl
If you did not get the Moon Pearl from the Tower of Hera, you will need to get it in order to proceed. To get it, walk slightly south and use the Magic Mirror to return to the roof of Hyrule Castle. From there, follow the directions in Up the Mountain to reach the Tower of Hera, and follow the directions in Tower of Hera to get the Moon Pearl.
About the Magic Mirror
You can use the Magic Mirror any time while in the Dark World to return to the Light World. This will leave behind a sparkling spot that you can step into to return to the Dark World at that location. While in the Light World, you can see the sparkling spot on your map, which you can press X to view.
Get a Piece of Heart
Go south from the top of the pyramid, then go down the eastern stairs. Go east to the small ledge, and jump down from it, then follow the ledge to find a Piece of Heart.
Get the Quake Medallion
Before you go to the Palace of Darkness, there are some items that you can collect first.
From where you got the Piece of Heart, go south, then jump off of the ledge. You will encounter new enemies throughout the Dark World, such as Snap Dragons, Hinoxes, and Moblins. Go east to the next area.
Go north, and keep going north until you see a broken bridge to the left. Lift the skull or the large boulder and go north to the next area. Kill or ignore the orange-and-green Ropa, then go east. There is a shop in this area. Go east from the building and lift the large boulder, then follow the path beyond the boulder. Continue on until you reach the area where Zora's Domain is in the Light World. This is the Lake of Ill Omen. In the west side of the water, you find a circle of stones. Throw something into it (a skull, a bush, a sign, etc.) and you will get the Quake Medallion. You can use it to kill many enemies on the screen with an earthquake, but it costs a lot of magic.
Get a Second Piece of Heart
Go south to the previous area, then get in the water and swim west. When you find a regular whirlpool (different from the temporary whirlpools that the orb-spitting Ku come out of), swim into it. From the whirlpool where you reappear, swim southwest and you will reach the area where Lake Hylia is in the Light World. Swim to the northwest of the lake to find a shallow area surrounded by stones. Be careful of the green Zirro that tries to drop explosives on you, stand in the northern half of the shallow water in the circle of stones, and use the Magic Mirror. You will arrive on an island with a Piece of Heart.
Get a Third Piece of Heart
From where you got the Piece of Heart, step into the sparkling spot to return to the Dark World. Go southeast to the next area, go east past the whirlpool, and use the dock to get out of the water. Use the Magic Mirror, then get in the water, swim west, and use the whirlpool. You will end up in the pond west of the Sanctuary. Go north until you reach the Lumberjacks' house. The tree that they were cutting looks different now. Dash into the south side of the tree and the leaves will disappear. Fall into the hole that is revealed in the tree trunk.
If you go north, you will find several fairies. Then go east through the door and take the Piece of Heart. Go east down the ledge and go south to go outside.
Go to the Palace
Go south to the whirlpool and use it to return to the area with the sparkling spot that was left behind when you used the Magic Mirror. Step into the sparkling spot (east of the whirlpool), then get in the water and swim west to the lake. From there, go northeast to the dock and use it to get out of the water. Then go north until you reach the area where the Eastern Palace is in the Light World.
Make sure you have at least 110 rupees. Go east and you will see some stone statues. Go east past the statues and you find some trees and an arrow pointing north. Follow the arrow into the hedge. You can see where you are through small holes in the top. Make your way north through the hedge, going side to side to find the hidden path, and you will find another arrow. Go north from that arrow, then west behind the back of the building. Keep going west, through a narrow hedge on the left. Go north, kill or ignore the Ropa, then go east through an opening near the corner of the hedge. As soon as you are through the narrow hedge, go south, then east into the large hedge. The path through the hedge will split into three as you go east. Go east through the middle of the three paths and you will come out on the east side of the hedge.
You will find that Kiki the monkey is now following you. Agree to give 10 rupees. Be warned that if an enemy hits you, Kiki will run away and you will have to go back into the east side of the large hedge to get Kiki to follow you again (just entering the east side is enough to get Kiki to rejoin you), and you will have to pay another 10 rupees.
Go east from the east side of the large hedge, go east through a narrow hedge, then north through another narrow hedge. Then go east and you will reach the Palace of Darkness. Go north to the entrance and Kiki will offer to open it for you for 100 rupees. This is the only way to get into the Palace, so pay the 100 rupees and Kiki will open the door. Enter the Palace of Darkness.