Perhaps you are unaware of the use of Einstein notation for brevity. In this case, we wish to perform a scalar contraction: $$\sum_{\alpha, \beta}g_{\alpha \beta} \ dx^\alpha dx^\beta = \sum_{\alpha} \sum_{\beta}g_{\alpha \beta} \ dx^\alpha dx^\beta $$
Based on the result you want, the metric signature is $(+, -, -, -)$ ; so the corresponding metric tensor is: $$g = \begin{pmatrix}1 & 0 & 0 & 0\\0 & -1 & 0 & 0\\0 & 0 & -1 & 0\\0 & 0 & 0 & -1\end{pmatrix}$$
The off diagonal terms are all zero, so $g_{ij} = 0 \ \forall \ i \ne j$ $$\sum_{\alpha} \sum_{\beta}g_{\alpha \beta} \ dx^\alpha dx^\beta = g_{00} \ dx^0 dx^0 + g_{01}(...) + g_{02}(...) + g_{03}(...) \\+g_{10}(...) + g_{11} \ dx^1 dx^ 1 + g_{12}(...) + g_{13}(...) \ + \ [...]$$
It is clear that this reduces to: $$\sum_{\alpha} \sum_{\beta}g_{\alpha \beta} \ dx^\alpha dx^\beta = g_{00} \ dx^0 dx^0 + g_{11} \ dx^1 dx^1 + g_{22} \ dx^2 dx^2 + g_{33} \ dx^3 dx^3$$
Substitute $g_{00} = 1,\ g_{11} = -1,\ g_{22} = -1,\ g_{33} = -1$ and with $dx^0 = cdt,\ dx^1 = dx,\ dx^2 = dy,\ dx^3 = dz$, you get your desired result:
$$\boxed{\sum_{\alpha} \sum_{\beta}g_{\alpha \beta} \ dx^\alpha dx^\beta = c^2dt^2 - dr^2}$$
Hope this helps.