That and which
Choosing between that and which depends on whether the following clause is essential to the meaning of the sentence (ie a defining clause), or whether it simply adds extra information that would not change the meaning if it was removed (a nondefining clause).
Use that if the clause is essential; use which if it is not. A nondefining clause is offset with commas:
Go to the first house that is brick and knock on the door.
[This means go the first brick house – there may be other houses built of other materials before the brick house; if you took out ‘that is brick’, you would not go to the right house (it changes the meaning).]
Go to the first house, which is brick, and knock on the door.
[This means go to the first house, and it happens to be brick; if you took out ‘which is brick’, you would still go to the right house (it does not change the meaning).]