How to Sort the cards?

How to group the cards

How to pick and discard card ?