You are West, declarer in 3NT, against which North leads the ♥Q. What is your best line of play? You can count two hearts, two diamonds and four clubs; the ninth trick can certainly be developed from diamonds.
Duck the first heart; no switch by North can hurt you, as a spade would set up your ninth trick without even touching diamonds.
If a heart is continued, win and cross to dummy via a club and finesse diamonds into North’s hand. Even if he wins with the ♦Q, your contract is safe because he can’t get South on lead to play through your ♠K.
You can always try playing towards ♠K for an overtrick at the end of the hand, when your contract is safely made.