How to suppress error messages in script

I am getting the following upon cat a file which is not present in directory.
"cat: cannot open test1.txt"
I need to process files and I want that this message should be suppressed. thx

When you run your script, run it as '/path/to/script 2>/dev/null'. This means that all the stuff that would be written to standard error is to be redirected to /dev/null.

Could please explain more, I am new to scripting so when you say "run it as '/path/to/script 2>/dev/null' "

this means I should add this line in my script?

No, it means when you run your script, add the exact text below right after the name of the script, before you press 'enter' on the command line.

2>/dev/null

If your script is named "x.sh" , then when you run it, type "x.sh 2>/dev/null".

Have look at this for more explanation: Meaning of "> /dev/null 2>&1"

... or just close fd 2:

cat test1.txt 2>&-

Regards
Dimitre