The word "which" is a pronoun. There are two main uses for this word. The first is as a means for asking a person to make a choice:
Which one do you want, the red one or the blue one?
Which store has lower prices, Jewel or Dominick’s?
Which of the four seasons is your favorite?
Vanessa isn’t sure about which cough medicine she should buy.
Rick knows exactly which laptop he wants to get.
Which of these is the best choice?
Which way do we go? (This question is often asked when walking or traveling.)
Which way did he go?
Do you know which way he went?
The second main reason for using "which" is when referring to an antecedent. An antecdent is a thing that appears before another thing in a sentence or question.)
That’s the shovel which we used for digging the garden. (The antecedent in this sentence is "shovel.")
The bakery makes beautiful donuts, many of which sell out before noon. ("Which" refers to the donuts.)
Kevin has a strong interest in joining the military, which would probably offer him a lot of good experience. (In this sentence, "which" appears at the beginning of a nonrestrictive clause.*)
When expressing uncertainty or confusion, "which is which" is very popular:
I can’t tell which is which.
These deserts all look good. Do you know which is which?
The kids all threw their jackets in a pile, so it’s hard to tell which is which.
*Note: The words "which" and "that" are often used interchangeably for clauses; however, "that" is considered to be acceptable for things and people, whereas "which" is not. Use "which" when referring to things.