I tend to use the word this at the beginning of a sentence when I want to refer to something I said in the previous sentence. For example:
The purpose of a singleton pattern is to allow only one instance of a class. This is beneficial when a program requires only one object to carry out operations for a class.
Grammarly gives me an "intricate text" warning when I use the word "this" instead of "that."
Can someone give me intuition to know which word to use? Thank you.