One possible source of confusion is the use of $i$ as the summation index on both sides. That is correct ($i$ is a dummy index and you can rename it at will as long as you are consistent about the renaming), but it might be easier to proceed in steps where you define a new summation index in terms of the old one and then, at the very end, you do the renaming.
E.g. in this case, consider the sum
$$
\sum_{i=n^2-3}^{n^2+n-4} (i+4)
$$
Let's start with a small step: define $j = i + 3$ in order to eliminate that pesky $-3$ in the lower limit. In terms of $j$, the lower limit becomes $j = n^2$, the upper limit becomes $j = n^2+n-1$ and the summand becomes $(j+1)$, so we get
$$
\sum_{i=n^2-3}^{n^2+n-4} (i+4) = \sum_{j=n^2}^{n^2 + n - 1} (j + 1)
$$
Working on the RHS, define $k = j - n^2$. That makes the lower limit $k=0$, the upper limit $n-1$ amd the summand $(k + n^2 + 1)$, so we have
$$
\sum_{j=n^2}^{n^2 + n - 1} (j + 1) = \sum_{k=0}^{n-1}(k+n^2 + 1)
$$
Now rename $k$ to $i$ on the RHS and ... oops! I just went back and saw that you wanted the lower limit to be $1$ instead of $0$. No matter: we can do another transformation: $l = k + 1$, so the lower limit becomes $l = 1$, the upper limit becomes $l = n$ and the summand becomes $(l + n^2)$. We get
$$
\sum_{k=0}^{n-1}(k+n^2 + 1) = \sum_{l=1}^{n}(l + n^2)
$$
Now rename the dummy index $l$ to $i$ and you get your RHS.
Obviously, you could do it all in two steps: $j = i - (n^2 - 3) + 1$ and then doing the rename, but maybe the multiple steps help.
And writing out the first few terms and the last couple of terms on each side will help to clarify what is going on.