This question comes up a lot, which/that isn’t surprising because it’s a confusing one. (But I bet you knew that ‘which’ was needed in that last sentence!)
Just ask yourself: is the information preceded by ‘that’ or ‘which’ essential, or is it extra information that doesn’t have to be there?
If it’s essential for the meaning, use ‘that’.
If you can remove that section and the sentence still says what you mean, use ‘which’.
Some examples of ‘which’:
The Good Grammar Company, which caters for business people who need to write well, is run by Kathy Salaman.
(If you remove the bit between the commas, you retain the essential information.)
‘Which’ relative clauses can also be at the end of sentences, but the same rule applies:
Many business people didn’t learn basic grammar at school, which is why The Good Grammar Company is needed.
Note the use of commas to demarcate information using ‘which’.
Example of ‘that’:
The training sessions that The Good Grammar Company offers are fun and informative.
As can be seen, taking out ‘that The Good Grammar Company offers’ leaves the reader wondering which* sessions are being discussed. (* ‘which’ in this context is a determiner so different rules apply. Don’t worry about it!)
Note that commas are not used for ‘that’ clauses.
For those of you who like labels and terminology: Restrictive and non-restrictive relative clauses.
A relative clause can be placed within or at the end of a sentence giving added information about the preceding subject. Relative pronouns indicate that a clause is a relative clause: which, that, who, whom, whomever, whose … these pronouns indicate a relative clause.
The use of ‘that’ as a relative pronoun indicates what is termed a restrictive relative clause. The use of ‘which’ indicates a non-restrictive relative clause.
When using ‘that’ as a relative pronoun (‘that’ can also be used as a determiner, which is a whole new blog post) it should indicate a clause that needs to stay for the sentence to make sense and its use is, therefore, restrictive. (Note the use of ‘that’ in that sentence. And note the use of ‘that’ as a relative pronoun and as a determiner in the sentence just before this one! )
I think I should stop now as I’m starting to confuse myself, ‘which’ isn’t that hard!