To discard a loser from one hand while ruffing in the other.
South is declarer and spades are trumps. If any hand other than West is on lead then East will win a heart trick.
However, with West on lead and obliged to lead a club, South can ruff in dummy and discard a heart from hand. Alternatively, he could choose to discard a heart from dummy and ruff in his own hand. As a defender, you generally want to avoid giving a ruff and discard if you can help it.