Play as Young Link, go to the market, then enter the castle grounds. You need to sneak past the guards to reach the castle and then avoid the guards inside.