To get out of this enclosed space, you must use the Magic Mirror. You might transport into a bush or rock, so you'll have to adjust your position so you can warp successfully. From where you end up in the Light World, move away from the warp point you left behind and use your flute to get to #2, the witch's hut. Go to the Waterfall of Wishing to get your green potion refilled. Then go back outside and warp to #6, the Desert of Mystery.
You end up on a previously inaccessible ledge with two black stones on it. Pick up the right-hand stone to reveal a Dark World warp. Step on it to find yourself in the Swamp of Evil (this is really its name; a sign outside of it in the Dark World refers to it as such), enclosed completely by mountains and thus inaccesible from the outside (and inescapable from the inside!).
There are a couple of pieces of heart you can get now that you're in here. Drop off the ledge and go north. Ignore the walkway you see; stay to the left of it. Up above, in the northwest corner of the swamp is a face-like thing with a mouth you can walk into, so go into it. Inside, avoid the fireballs as you head north, down the stairs, to a block puzzle.
In the bottom row there are two blocks. Push the right-hand one to the right. That gives you access to the first chest. Then, still in the bottom row, push the left-hand block to the left. Push the block above you up, then get around to the right side of the block in front of the chest and push it left. Get both chests for a piece of heart (left chest) and 20 rupees (right).
Exit this chamber and go back out to the swamp. There is yet another piece of heart you can get. You have to warp to the Light World to get it. Go to the northeast corner of the swamp (from where you got the last piece of heart, you can just go around the north of it and walk along the north wall of the swamp). The northwest corner kind of goes into the wall a bit; stand nestled in that spot and use your Magic Mirror to return to the Light World. You find yourself on a ledge in the desert next to a large white stone. Pick it up to reveal steps down. Go down them to find another block puzzle protecting the piece of heart. There are two blocks you can push from where you enter. Push the bottom block to the right, then push the block above you up, the block to your right right, and the block above that right, and you reach the piece of heart. Go back outside and warp back into the Swamp of Evil. You may have to try a couple of times because you might warp back into the rock face. If you're returned to the Light World, walk into the warp point while you're still flashing so you can warp properly.
Once you're back in the Swamp of Evil, head to the center of the water to the walkway you may have seen earlier. Walk up it to the top, where you see a lightning bolt symbol on the ground. Look familiar? Look in your inventory and you'll notice the Ether Medallion has the same symbol on it! Stand on the symbol in the swamp, and use the Ether Medallion. The screen will flash, the rain will stop, and a large mouth will surface from under the water. Go into it to enter...