Ruff the opening lead, play three rounds of hearts discarding a spade from dummy, cross to the ♣A, ruff a second diamond, and then over to the ♣K.
If the queen drops, you have 13 tricks. If it doesn’t, discard the ♣J on the ♦A and ruff a club. If clubs are 3–3, you have 13 tricks. If not, your last four cards are spades and dummy has the ♠K–x, a low club and a low diamond. If spades are 3–3 you have the rest. If the player with four spades has either the long club or the long diamond, that player has been squeezed out of a spade earlier.
As you can see, you have multiple chances to make the contract: The ♣Q singleton or doubleton, clubs 3–3, spades 3–3, or the player with four spades having either the long club or the long diamond.
If hearts are 4–1, you do not have the luxury of ruffing two diamonds and a club. You will, in all likelihood, have to settle for ruffing one diamond and one club, losing some of your squeeze positions.