If diamonds are no worse than 4-2, then we can set them up with two ruffs without losing the lead. We will need three entries in dummy – two for the ruffs and one to reach the established length. But we need to have drawn trumps when we use the long diamonds. So, win the first trick, cross to ♦A, ruff a diamond low, cross to ♠A, ruff a diamond with ♠K (in case West is doubleton), cash ♠J and ♠Q. Then draw the last diamond with the king.
If instead we start with a heart ruff, then we won't have enough trumps in dummy to set the diamonds up with all the trumps drawn. We will gain one trick from the heart ruff, but end up with only a single diamond discard instead of three.
Don't ruff a loser in dummy if it jeopardizes the establishment of dummy's long suit for multiple discards.