The danger is that West has led a doubleton club holding ♥Q x x x. Your answer is to play the ♥A K: If hearts are 3–2, the most you can lose is a heart, a spade and a club.
The key is to test diamonds before clubs. Play the ♦A K: If anyone shows out, shift your attention to clubs and hope they are 2–2, which will still give you nine tricks.
If both follow to the ♦A K, cash the ♦Q. If diamonds break 3–3, forget about clubs, cash the fourth diamond and drive out the ♥A, giving you nine tricks. If diamonds turn out to be 4–2, play on clubs and hope they are 2–2.
If you test clubs before diamonds and they are 3–1, they will drive out your last spade stopper while they still have a club winner, and you will have zero chance to make your contract.