Three Ways to Make

A 10 6
8 5 2
Q J 10 6
Q 10 6
8 7 5 2 K J 6 3
------ 9
K 9 8 2 A 7 5 4 3
K J 7 4 2 9 8 5
Q 9
A K Q J 10 7 6 4 3
------ Opening lead: 2 of diamonds
A 3 Contract: 6 hearts

You have three lines toward making this hand, all of 'em working, indeed, one of 'em certain after the opening lead. In fact, West's only safe lead would have been a heart, so it would appear he was destined to make a favorable lead. Declarer went in with the 10 of diamonds, ace from East, as declarer sluffed his club loser. Sluffed his club loser!
With 9 trump, he didn't feel he could spare one? Further, the trey of clubs isn't exactly a loser. Well, it's not an out-and-out loser. Sometimes a card can hardly be expected to win a trick, but can be worth a trick. I mentioned that a few days back when a declarer sluffed a card he could ruff in dummy to keep a card he couldn't. Declarer, with a trump in each hand, the opponents having no more, could no longer cash his two trump separately, which the card he sluffed would have allowed him to do. So it was worth a trick, though it wouldn't actually win a trick.
The same can be said of the 3 of clubs here. It was worth a trick, because after cashing the ace of clubs, declarer could lead toward his queen of clubs, thereby establishing it as a winner. If you can't lead toward the Q of clubs, you can't make a winner out if it (on which to sluff a spade). But when declarer sluffs the three, that valuable card is obviously of no use on the hand, and declarer could no longer make the hand. He can only run 11 tricks, which is what he did.
How many entries do you have to dummy? If you said one, go to the bottom of the class. You have three entries to dummy, and so plenty to make use of dummy's potential beyond the ace of spades. Without the 10 of diamonds (I'll get to that suit in a minute), declarer would have a chance if either black king sat before the queen, and he guessed right. Here, you can see that both sit before their queens, and it doesn't matter whether declarer, after taking one round of trump, goes to dummy with the five of hearts and leads toward the queen of spades, subsequently cashing the queen and then going to dummy with the 8 of hearts, sluffs his club, or he lays down the ace of clubs and then leads toward the queen, later to sluff a spade on the queen.
But dummy does hold the 10 of diamonds, along with the Q and J, and with that opening lead, declarer had an assured contract if he'll only ruff that ace of diamonds, draw one round of trump, go to dummy with the 5, lead a second diamond honor, sluffing either a small club or a small spade, later to sluff the other loser on the third diamond honor, which you reach with a low trump to the 8.
Suppose for the moment that West had held the sole trump out and had led it. Now declarer would have been faced with three choices, the third being to initiate the diamonds himself, only now he'd have the concern that West had both top honors, which concern he was relieved of, or should have been relieved of with the diamond opening lead. It would be close to a double hook against the K and Q. You can live with both honors second hand or one honor second hand, but you're outta luck if both come down fourth hand. This is a 75% chance and therefore favored over a simple 50-50 chance.
You would go to the ace of spades, lead the queen of diamonds, sluffing a spade if not covered, ruffing if covered. Then you return to dummy with the 5 of hearts, lead the second diamond honor, and unless West has both, you ruff out East's honor and with the third diamond honor, you sluff the low club. Here declarer would have just enough entries.