[sentence (goal)]。そのために、[sentence (action)]。 [sentence (cause)]。そのために、[sentence (result)]。
そのために points back at the sentence before it and has two meanings. After a goal, it means "to that end": the next sentence is what you are doing to reach it. After a cause, it means "because of that": the next sentence is the result.
The two halves tell you which one it is. A goal – often a たい sentence or a plan – followed by something done on purpose is "to that end". An event followed by something that simply happened is "because of that".
For purpose, に stays: そのために. For cause, the shorter そのため is more common.
With the "because of that" meaning, the second half reports a fact. A request, an invitation or "let's" needs だから.
そのために is その plus ために. Without その, ために attaches straight to a dictionary-form verb or to a noun with の, and works inside one sentence. In conversation that is the usual way to give a purpose, and a cause more often takes だから or それで.