The word "that", can be left out in many situations. However, many situations require it.
In some situations the word "that" does not change the meaning of overall sentence so it can be left out as in the example below.
I believe speaking English helps you in life.
I believe that speaking English helps you in life.
You may wonder which of the sentences above is correct. Both are correct but the first one is more common.
In some situations the word "that" is absolutely necessary otherwise the reader will be confused.
I think the phone that has the biggest screen is more beautiful.
I think the phone has the biggest screen is more beautiful. (This sentence is INCORRECT)
In the first example "that" gives you more information about a noun and leaving it out requires leaving out the “more information” that comes with it. The second sentence makes sense until the reader reads “... is more beautiful”.
In other words, you must use "that" if it modifies the subject of the independent clause. In other situations using "that" is not necessary, optional, or incorrect.
Using "that" as a complement of a preposition is incorrect as is shown in the example below.
I finished my homework before that you arrived home. (Using "that" in this situation is INCORRECT)