Understanding the Difference Between "That" and "Which" in English
The words "that" and "which," known as relative pronouns, are used to add more information to a sentence by introducing an additional part (a subordinate clause).
That
That is used to give you more information (essential) about the objects we are talking about; it is also known as a restrictive clause and gives you more details about the context, and this way we avoid confusion.
The movie that I watched yesterday was good.
Here we mentioned a movie, but we need to give extra information about what movie we are talking about, so we added "I watched yesterday" as an additional part to the sentence.
No comma is needed for the additional part we added here.
We can remove that, but we cannot remove the part we added.
"The movie I watched yesterday was good" is still correct.
You can use "that" to refer to people as well, but
"That" is generally considered less personal or informal when used for people compared to "who" or "whom."
For example:
Informal: "The guy that I met yesterday was very nice."
Formal: "The person who I met yesterday was very friendly."
"Who" or "whom" is often preferred for more formal writing or when you want to describe the person's identity or humanity.
"The doctor who treated me was Dr. Jhon."
"She is the coach whom I admire the most."
Which
"Which," also known as a non-restrictive clause, gives additional information but is not important, meaning that we can remove the additional part we added, and still the sentence will be correct.
Let's assume I have a gray-colored car. So we can say, "My car, which is gray, looks great." Here we added more information to the sentence, but it is not necessary. We can just say "My car looks great".
For the "which" clause, we need to add a comma before and after the part we added.
We can remove the part we added, and the meaning of the sentence will not change.