"This" is analogous to "here", whereas "that" is analogous to "there". If you mentally substitute this/that with "this here" or "that there", one will often seem to be the obvious choice. Another way of thinking about it is if you imagine actually showing the other person the thing you are talking about, would you point to it, or hold it up to show them? If you would point to it, use "that"; if you would hold it up to show them, use "this".
For a concept or idea introduced a few sentences before, I think the key thing is whether it was introduced by you or the person you're talking to. If you introduced it, you're "holding" the idea - use "this". If they introduced it, they're "holding" it - use "that".
As for your last sentence ("Is there a rule describing proper usage of these words in cases like this?") "this" sounds much more natural and correct. I think that's because you are presenting some examples for consideration, so you can imagine that you are holding them in your hand/head and showing them to the target of your question, hence "this".
Interestingly, if I were to then refer to your examples I could use either "this" or "that". Both would sound fine, but have different implications. "This" implies that I have taken your examples/concept/idea into my own headspace to examine and consider close-up, and am still considering them. "That" implies that they are with you, rather than me; either because I'm considering and commenting on them from "over here", as your examples, or possibly that I've brought them into my own headspace, considered them, and have given them back to you prior to commenting on them. Either way, the implication is that they are your examples - I haven't taken on shared custody of them.
"This" and "that", much like their counterparts in most other European languages, indicate relative proximity. "This" refers to a thing that is literally or figuratively "here", as in "within reach" of the person. "That" refers to a thing that is literally or figuratively further away, but "within view". "At this time" is thus normally used when referring to the present time, and "at that time" is used when referring to specific past or future times.
HOWEVER, "this" can also be used to refer to something being discussed in the present context, even if the subject of the discussion is far away in place or time. "At this point in time" or simply "at this time", then, could be used to refer to the particular point in time that is central to the discussion. Similarly, one could point at something they're holding in their hand and refer to it as "that". So, more generally, "this" is something central and implicit in the statement; "that" by contrast is something more separate or which must be identified by location or time.
Best Answer
'This' has the sense of 'happening now'; 'that' has the sense of 'the effect once it is already completed' - along the lines of what others have said about 'distance'.
'That' is more impersonal and abstract, 'this' has more involvement and is livelier.
Hope this helps! (Direct wish for now) Hope that helped! (More abstract impersonal wish thst doesn't really need an answer)
😊