You have freed Zelda from her jail cell, and now the two of you must escape from Hyrule Castle.
Reach the First Floor
If you don't have the Lamp, be sure to open the chest in Zelda's jail cell to get it. After you talk to Zelda and she starts following you, exit Zelda's jail cell and go back the way you came. When you reach B1, keep going south until you have gone up the stairs in the southwest corner of the room with the two green soldiers. Go east along the ledge, then north up the narrow stone walkway, then go east to the next area. Follow the path to the next screen and jump off the ledge. Go north up the stairs and through the door. Go north up the stairs and you will reach the first floor.
Find the Secret Passageway
Go east to the next room, then go north up the stairs, and walk south along the upper path, then jump down to the lower area and go through the south door. Go south and follow the carpeted path to reach the first room of the castle. Zelda will tell you to go to the throne room to find a passage leading to the Sanctuary. Go north up the nearby stairs and find the door in the north wall. Go through it.
Quickly go north up the stairs to avoid a fight with the blue soldiers, and continue north until you reach the thrones. There is an ornamental shelf behind the thrones. Zelda asks if you have a Lamp, then says to push the shelf from the left. Note that if you never picked up the Lamp along the way, you won't be able to push the shelf, and you will have to go back to Zelda's jail cell to open the chest there to get the Lamp before you can proceed.
If you haven't already, walk behind the thrones and go to the left side of the ornamental shelf, and push it to the right. Then go through the door behind it.
Go through the Secret Passageway
The room is dark. Be careful to watch for rats. Rats often drop high-value rupees, so you may want to take the time to kill the rats that you encounter.
Go north, then east when you can, then north again, and you will find stairs leading down. Go down them.
In this hallway there are Ropes (snakes) coming from the west, so carefully go west past them, then go north down the stairs.
There are more Ropes here, as well as some Keese (bats) that will fly around if you get close to them. Go north and then east to find a chest. Open it to get a key. Then go west and north to the locked door, and go through.
Zelda says that you are in the sewers and are close to the Sanctuary. Go north, then west, and go through the door in the west wall.
Go north, then west, to find a Keese. Go west from it to find a door in the north wall. Go through.
Go west and kill the rats in this area. One of the rats is carrying a key. Kill the rats until you find the key, then go east, then north, and kill the Keese, then go north through the locked door.
Go north to find a block puzzle. Push the top middle block up and continue up the stairs.
In this wooden room, go through the south door.
Zelda tells you to pull the switch "over there" but doesn't tell you which one. The correct switch is on the right side of the screen. When you approach it, Zelda will explain how to use it (walk up to it and hold A, then press down). This will open the door to the Sanctuary. Go through. You will be asked to visit the Village Elder.