You treat $i$ as a variable and carry it along.
$i$ is a number with a property: $i^2 = -1$, and it collapses on the line where it appears, not later. Like terms combine the way numbers do: $-2i + 3i = i$.
Next time: Replace $i^2$ with $-1$ immediately, every time.