When to Use Which Or That?

That is used in sentence that contain a restrictive clause. Ex. ‘For ‘that’ matter…the word that is speaking of a specific matter. ‘Which’ is used non-restrictively. ‘For the matter ‘which’ we were discussing….is used non-restrictively.