[sentence (cause)]。そのため、[sentence (result)]。 [sentence (goal)]。そのために、[sentence (action)]。
そのため means "because of that", "for that reason": the sentence before is the cause, and the sentence after is what resulted. It opens the second sentence, and it is the formal, written counterpart of だから – news, reports, notices, explanations.
The result is a fact – something that happened or a state of affairs. A request, an invitation or "let's" after a cause needs だから.
After a goal, そのため means "to that end", and the next sentence is what you are doing to reach it. In this meaning に is normally kept: そのために.
Which meaning you have depends on the two halves. A goal followed by a deliberate action is "to that end"; an event followed by an outcome is "because of that".