Grammar draws a distinction between two kinds of clause: “restrictive” and “non-restrictive.”
A restrictive clause, not surprisingly, restricts the noun it modifies (refers to). It defines it, or gives it limits. For example:
Grammar draws a distinction between two kinds of clause: “restrictive” and “non-restrictive.”
A restrictive clause, not surprisingly, restricts the noun it modifies (refers to). It defines it, or gives it limits. For example:
The shoes that are on the stairs…
“that are on the stairs” is a restrictive clause, because it defines the shoes you mean: you will be talking about those shoes and no other (you restrict your remark to those shoes).
A non-restrictive clause, also not surprisingly, does not restrict the noun it modifies; a non-restrictive clause gives additional information that is not necessary.
The shoes, which are black, are on the stairs.
It just happens to be the case that the shoes are black; you don’t need to know that. Because of this, one useful way to think of “which” is as the word you use for parenthetical, or “by the way” clauses: clauses you can remove from a sentence without removing any vital information.
The most common mistake writers make with “that” and “which” is using “which” where you really want “that.” For example,
You can’t always get those things which you want.
Look closely! You’ll see that here you need “which you want”: if you said, “You can’t always get those things,” the sentence wouldn’t make sense. Thus, “you want” is a defining (or restrictive) element, and the sentence should read:
You can’t always get those things that you want.
Eventually, differentiating between these two will become a matter of instinct: you will feel when you need “that.” Until that point, you can do one or both of the following:

Ask yourself if what comes after “that” or “which” is necessary information. If it is necessary, you want “that”; if it isn’t, you want “which.”

Put a comma in front of “which.” Does the sentence still make sense? If not, you want “that”; if so, leave “which” (and the comma!).
It’s never “it is…which….” It’s always “it is…that….”
If “which” is being used to herald a non-restrictive clause, it almost always takes a comma in front of it.
The differentiation between “that” and “which” is a rule some people made up at the beginning of the 20th Also, virtually no one understands or implements it. So it’s no tragedy if you don’t use the two words correctly (on the other hand, knowing how to use them correctly makes you superior to nearly everyone, and that’s always a good thing).