To find $ n $ we use formula
$$ \color{blue}{S_n = \frac{n}{2} (2 a_1 + (n-1)d) }$$In this example we have $ a_1 = -6 ~~,~~ d = 2 ~~,~~ S_n = -10 $. After substituting these values to above formula, we obtain:
$$ \begin{aligned} S_n &= \frac{n}{2} (2 a_1 + (n-1)d) \\ 2 \cdot \left( -10 \right) &= n (2 \cdot \left( -6 \right) + (n-1) \cdot 2) \\ -20 &= n (2 \cdot n -14) \\ 2n^2-14n+20 &= 0 \end{aligned}$$The solutions of this quadratic equation are $ n_1 = 2 $ and $ n_2 = 5 $ (click here to see detailed explanation on how to slove quadratic equation).
The first few terms of this sequence are:
$$ -6, ~~~-4, ~~~-2, ~~~0, ~~~2 . . . $$