Omitting that is acceptable in this context; a more detailed description of when that may be omitted is available at your later question, When can I remove the word 'that' in a sentence?.
As to the suggestion “don't use ‘that’ frequently in writing and try to avoid it wherever possible”—this is an overstated and under-nuanced version of what is actually very sound practical advice: be careful of how and when and how often you use this overworked word.
That has five distinct uses in English:
- As a demonstrative pronoun: That’s the man I saw!
- As a demonstrative adjective (determiner): I saw that man!
- As a relative pronoun (relativizer): He’s the man that I saw.
- As a subordinating conjunction (subordinator): I told you that I saw him.
- As an adverb: The man was about that tall.
That’s a lot of uses; and they’re all very common, so it’s very easy to use that repeatedly without noticing. It's even possible to stack four thats in a row, in four different senses, without being grammatically ‘incorrect’:
I told you that4 that1 that3 that2 man said was totally false.
That’s hard to parse; and even though you’re unlikely to produce anything that awkward (I had to work hard to produce that), you still want to be careful not to confuse the reader even momentarily by using too many thats. It’s bad practice to use any word in two different senses in the same short passage; and this is particularly dangerous with that, because one of its uses (4) is to distinguish major syntactic units.
So be careful with your thats. Repetition of that in the same sense is OK, because it can establish rhetorically useful parallels; but if you notice you’re using it in different senses, look for ways to paraphrase. Here are a few:
- You may omit many conjunctive4 and relative3
thats (see the link).
- You may always substitute who or which for relative3
that.
- You may often replace a demonstrative pronoun1 with a personal pronoun or with what.
- You may sometimes replace the demonstrative adjective2 with this, or the adverb5 with this or so.
And so forth. Don’t avoid using that—that’s just silly. But do avoid using that confusingly.