To form the Ricci curvature tensor, we have to take the trace of the Riemann tensor. But I also know \begin{equation} R_{ij} := R_{kij}^{\phantom{kij}k} \end{equation}
Can someone show me why taking the trace is the same thing as contracting indices?
Consider the following matrix
\begin{equation} A = \begin{bmatrix} a & b & c \\ d & e & f \\ g & h & i \\ \end{bmatrix} \end{equation}
By definition, the trace of $A$ is defined as
\begin{equation} \text{tr}(A) = a + e + i = a_{11} + a_{22} + a_{33} \end{equation}
So think about how we write tensor indices. If I have a tensor $a_{ij}$ and I contract one index to get $a_i^i$, now both indices have the same value. So for all values of $i$ in this case we would have $a_1^1$, $a_2^2$, $a_3^3$, which corresponds to $a$,$e$,$i$.
Thus, contracting indices gives the same value as taking the trace.