When declaring, seldom is there only one line for your contract. The art of good dummy play is to count your tricks and search for fall-back positions.
South had to decide whether to jump to two no trump or rebid one heart over North's one-diamond response. The problems with the latter are that the hearts aren't robust and North might elect to pass on many hands that would offer good play for the no-trump game, so South opted for the former and reached an excellent contract.
There are two ways to land the contract: Find diamonds 3-2 or the queen of clubs on side. Obviously, the diamonds must be tested first.
If you cash the ace and queen of diamonds and the suit does not break favorably, you can use the ace of hearts as an entry for the club finesse. But you will be limited to one finesse, and will be defeated if East has the queen of clubs guarded twice. Is there a way to counter this?
Yes, if you are prepared to take measures to overcome a 4-1 diamond division. Win the spade lead, cash the ace of diamonds and overtake the queen of diamonds with the king. If both defenders follow, concede a diamond trick and the ace of hearts is still in dummy as an entry to cash three more diamonds.
The wisdom of your willingness to sacrifice a trick and not rely totally on diamonds is revealed when East discards a heart on the second diamond. Now you abandon diamonds and run the eight of clubs. West wins the ace and forces out your remaining spade stopper. You cross to the ace of hearts and run the jack of clubs, and you are home with an overtrick even if East started with four clubs to the queen.
Both vulnerable. South deals.
K 8 6 4 3 2
J 8 4
Q J 10 7 4 9 8 5 2
8 5 Q 10 7 4 3
J 10 9 5 7
A 6 Q 7 3
K 9 6 2
K 10 9 5 2
South West North East
1 Pass 1Pass
Opening lead: Queen of spade.