I can't understand the difference between "it" and "that".
What is the difference between:
Was it a problem?
Was that a problem?
That refers to things that have a prior antecedent, meaning it has a reference to something previously mentioned. That can also be used to clarify a contrast between two references.
It is similar to that but doesn't not require an antecedent.
If someone spoke of two problems, that would typically refer to the latest problem mentioned, but if you used it, the hearer may not know which problem you were asking about.