If we have a Riemannian manifold $(M,g)$ with constant sectional curvature $C$ I have proven that the $(1,3)$ curvature tensor $$R(X,Y)Z = C(\langle Y,Z\rangle X - \langle X,Z\rangle Y)$$ and that the $(0,4)$ Riemannian curvature tensor is given by $$\operatorname{Rm}(X,Y,Z,W) = C(\langle X,W\rangle\langle Y,Z\rangle - \langle X,Z\rangle \langle Y,W\rangle)$$ now I would like to prove that the Ricci curvature, defined by $\operatorname{Ric}(X,Y) = \sum_{i=1}^n \operatorname{Rm}(X,e_i,e_i,Y)$ is given by $C(n-1)g(X,Y)$. I'm sure this should be a somewhat simple exercise given that we know what the Riemannian curvature is in this situation, but I cannot get any further than: $$C\sum_{i=1}^n (g(X,Y)g(e_i,e_i) - g(X,e_i)g(Y,e_i))$$
Any help is appreciated!
Recall that $\{e_i\}$ is an orthonormal basis so $g(e_i, e_i) = 1$.
Writing $X = \sum_{j=1}^nX^je_j$ and $\sum_{k=1}^nY^ke_k$ we see that
$$g(X, e_i)g(Y, e_i) = g\left(\sum_{j=1}^nX^je_j, e_i\right)g\left(\sum_{k=1}^nY^ke_k, e_i\right) = \sum_{j,k=1}^nX^jY^kg(e_j, e_i)g(e_k, e_i) = X^iY^i.$$
Now note that
$$g(X, Y) = g\left(\sum_{j=1}^nX^je_j, \sum_{k=1}^nY^ke_k\right) = \sum_{j,k=1}^n X^jY^kg(e_j, e_k) = \sum_{j=1}^nX^jY^j = \sum_{i=1}^nX^iY^i.$$
Therefore,
\begin{align*} C\sum_{i=1}^n(g(X, Y)g(e_i, e_i) - g(X, e_i)g(e_i, Y)) &= C\sum_{i=1}^n(g(X, Y) - X^iY^i)\\ &= C\sum_{i=1}^ng(X, Y) - C\sum_{i=1}^nX^iY^i\\ &= Cng(X, Y) - Cg(X, Y)\\ &= C(n-1)g(X, Y). \end{align*}