Name a card cost. Each other player reveals the top 4 cards of his deck, and discards any cards with the named cost, and puts the rest back in any order he chooses.
Name a cost in Coins (and/or Potions) which will apply to all players. If any of the 4 cards each player reveals has exactly that cost it must be discarded. A player could potentially discard all of their revealed cards, none of them, or some number in between.
For example, if you named "3 Coins", each player would have to discard any Silver, and any other cards which had that cost, that they revealed.
You may name any card cost, even one which does not match any card, in which case the other players won't have any risk of discarding any cards.
If there aren't 4 cards left in a player's deck, they reveal as many as they can, then shuffle their discard pile, and reveal the rest. If there still aren't 4 cards, they just reveal as many as are left.
Each player may put the remaining cards back in any order they like, without showing other players the new order.