Getting the Sand Wand
Go straight into the Temple. You'll see a hammer and a switch that activates the hammer, but you can't use it properly yet. Go up to the right corridor. You must walk up through the boulders, weaving about them and avoiding them. The small area to the left is a trap. Turn left at the end of the path. Stand on the blue tiles and prepare an arrow. Fire at the eye when you see a clearing through the boulders. The blue door will open. Enter and open the chest for... one Rupee? The door will close and you'll have to battle several Stalfos. Defeat them all and a chest will appear. Open it for a Small Key. Return to the front area and go north to find a locked door. Open it and go upstairs.
Cross the bridge. Jump down and go south. The sandy enemies here, the Gerunes, can't be defeated with your sword. Ignore them and go right. Go north, avoiding the rolling objects here, and go upstairs. Go south and the door will close. There are three Stalfos Warriors. They are like normal Stalfos, and defeated in the same way, but sometimes attack you with their swords. When all are defeated, the blue door will open. Enter and go north. The large chest contains the Sand Wand. To use it, equip it and tap a sandy area to raise it. Return to the previous area. Stand near the north-west corner, against the north wall, and use the Sand Wand to raise the sand below you. Now you can step onto the ground above, and escape the floor to the right.
Go south. The three rolling objects are now in line. Use the Sand Wand to raise the sand in front of one of them, stopping it and allowing you to pass. Go south and left. The door will close. Two Gerunes will appear. To defeat these, tap and hold them, tracing the stylus over them as they try to escape. Eventually they will become solid and you can pick them up or attack them with the sword. The three locked doors will open when they are both defeated. Go north and avoid the rolling object. Stand against the north wall and use the Sand Wand to raise the sand underneath you, so you can stand on the above platform. Use it again to stop the rolling object on the solid ground, allowing you to cross it. Go downstairs.
On the sand in front of the entrance is a large boulder. Stand by the purple switch and use the Sand Wand. Use it to manoeuvre the boulder onto the slot in front of the hammer. Once it is there, strike the switch. The hammer will strike the boulder, which will in turn destroy the wall blocking the door. Don't go down the stairs yet, instead go left. Use the Sand Wand to roll the object blocking your path into an abyss. Go north and stand on the blue tiles. Equip the Whip and cross the abyss with the whip posts to the right. Move this object out of your way, and go north. Go left past the blue door. You'll see three eyes. Once you hit one, you'll have a short time in which to hit all three. Start with the top two, by using the Sand Wand to get up to their level. You can hit both without moving, and this saves time. Then wait for the sand to lower, and you can hit the bottom one. The nearby blue door will open. Enter and go north, and right into the little area. Use the Sand Wand to move the object south, allowing you to pass. Stand in the north-west corner, and raise the sand so you can continue left. Go up, and south. You'll see a small staircase. Stand on the edge of it and equip the Sand Wand. Roll the object north so it creates a bridge. Go south and stand on the edge of the next little staircase. Roll the object south to you, and cross it. Go left and defeat the Gerunes. A chest will appear. Open it for 20 Rupees.
Return to the corridor to the right you went to earlier. The boulders are coming in groups now, so cross to the sand pit, and raise it to reach the higher level. Go up and, when you see a clearing, jump down and go left. Look north to see two stationary boulders. Move them away with the Sand Wand, and shoot at the eye with an arrow. The blue door will open. Some enemies are shuffling about under the sand. These are called Ergtoroks. Use the Sand Wand to get them out, then go up and attack them with the sword. A chest containing 20 Rupees will appear. Use the Sand Wand on the path south of the chest to dig up a Small Key. Now go down the stairs you revealed earlier, north of the Temple's entrance.
Getting the Boss Key
As Anjean said, this is the most difficult Temple, and you now stand on the most difficult floor. Begin by going left and creating a bridge with the sand to the door. Unlock it and enter. Harden the Gerunes, but don't defeat them. Pick them up and place them on the two switches. This will open the door. Enter and go north. This corridor is made entirely of quicksand. To the left is a Stamp Stand. Go straight up and right to continue in the Temple. Use the Sand Wand to solidify the sand, and create a path through the sand. Be careful, since there are several machines firing arrows constantly. When you reach the end, you are faced with a large block puzzle. Stand to the north of it and equip the Sand Wand. You need to manoeuvre the block in such a way that the blue point will slot into the blue hole. Move it right, down, down, right, up and left. The blue door to the south will open.
Here, create a massive wall of sand to stop a boulder, and roll it into the slot by the hammer and switch, which you will not strike yet. South of here is a floor switch. Stand on it to create a bridge, and throw the Boomerang at the purple switch. The boulder will smash the wall blocking your progress. Step off the switch (this gets rid of the bridge) and stop another boulder. Roll it onto the bridge so you can cross. Go left. Another, bigger, harder block puzzle. Move the left one down, left three times, and south. The other one is much more complicated. Just move it about until it slots in. The blue door in the south-west will open. Go through. A spiked object is rolling around. Go left and into the safe area in the south. When it is right of you, you can pass safely. Defeat the Stalfos Warriors, and a chest will appear containing a piece of treasure. Stop the bottom rolling object, and surround the top of it with raised sand. You can walk on top of it and stand on the switch to the south. This opens a door. Stop both rolling objects in line with each other and the door to create a bridge to the door. Enter and the door will close again behind you. You must defeat the Ergtoroks as before (get them out with the Sand Wand, then attack). There are four, and when all are gone, the doors will open. Go north. Use the Sand Wand on the two sparkling areas for 100 Rupees and the Boss Key. Pick it up and go south. Drop the key at the end, stop the rolling objects, pick up the key, and continue. Go east, avoiding this rolling object. Drop the key, and equip the Sand Wand. Move the left block down, left, up, right, and down. Move the right block down, right, up, up and left. The pink door to the north will open. Pick up the key and go north. Drop it at the edge of the quicksand pit, create a bridge with the Sand Wand, pick up the key, and cross. Open the Boss Door and go downstairs.
Go north. At the north wall, lift yourself up. Check the sign to activate a portal. Save your game and enter the door.
Boss: Capbone (Skeldritch), Ancient Demon
Make sure you have the Sand Wand equipped. Walk up to the skull in the centre. Capbone/Skeldritch, the Ancient Demon, will awaken, and his body will rise from the sand. A hole will open in the bottom section of his body, and it will shoot out a boulder. You need to create a large wall to stop the boulder, then roll it into the hole in front of the hammer. Strike the switch to fire the boulder at him, and it will strike the vertebrae and break away the bottom of his body. The next section will fire three. Get one into the hole, and fire. It will break off the vertebrae, and now his armoured body is at ground level. One piece of the armour will break off as well. Now you need to get a boulder into the hole by a hammer, then walk away so it is to the right. Throw the Boomerang at the switch to fire the boulder at the exposed vertebrae. Now the boulders will come at you extremely fast, and you need to create massive walls of sand to stop them. He will also begin to shoot lasers, so just avoid them. Get a boulder into the slot, walk around so it is behind Capbone/Skeldritch, and throw the Boomerang at the purple switch. The boulder will strike. The next section of vertebrae will break off. He will use the same tactics, so you should use the same as well. The only difference is that he now shoots out four boulders. Get the first one out of the way, then just block the other three. Move the one boulder left into the slot, and get it to the left of Capbone/Skeldritch. Throw the boomerang at the switch, and the last section of vertebrae will break off and Capbone/Skeldritch will fall to the ground. His helmet will fall off and reveal a ruby inside his skull. This is his true weak spot. Now he will move around. Get behind him. Block his path with the Sand Wand, and create a path to the ruby in his skull. Attack it with your sword. Do this twice to defeat him.
The sand will disappear, revealing a large treasure chest and a staircase. Open the chest for a Heart Container. Now go down the stairs. Go north up all the staircases. At the end of the room is the Bow of Light! It works the same as the ordinary Bow and Arrows, but first you must hold the screen to charge the Light energy before shooting. Zelda can feel a strange power from the Bow of Light. On the other side of an abyss behind the chest is the portal. Shoot a Light Arrow at the eye behind it. A bridge will appear. Cross it and step into the portal. Board the Spirit Train.