Let $V=\mathbb{R^3}$, $A=\begin{pmatrix} 0 & -2 & 1 \\ -2 & 1 & 2 \\ 1 & 2 & 0 \end{pmatrix} \in M_3(\mathbb{R})$ and $s$ the symmetric bilinear form on $V$ with respect to $A$, $s(v,w)=\langle v,Aw \rangle$.
How to determine a basis $B$ such that the transformation matrix is $M_B(s)=$diag$(I_k,-I_l,O)$?
Firstly, I computed the characteristic polynomial $p_A(\lambda)=-(\lambda-1)(\lambda+3)(\lambda-3)$ so I get the Eigenvalues $\lambda_1=1, \lambda_2=-3$ and $\lambda_3=3$ and the eigenvectors
$v_1=\begin{pmatrix} -1\\-1\\1 \end{pmatrix}, v_2=\begin{pmatrix} 1\\0\\1 \end{pmatrix} $ and $v_3=\begin{pmatrix} -1\\2\\1 \end{pmatrix}$.
Then I used the Gram-Schmidt process and got for $v_1=\begin{pmatrix} -1\\-1\\1 \end{pmatrix}$ the vector $w_1=\frac{v_1}{\sqrt{s(v_1,v_1)}}=\frac{v_1}{\sqrt{\langle v_1,Av_1 \rangle}}=\begin{pmatrix} \frac{-1}{\sqrt{-9}}\\\frac{-1}{\sqrt{-9}}\\\frac{1}{\sqrt{-9}} \end{pmatrix}$
Here I don't know how to continue.
I know the result is $B=\{v_2,\frac{1}{\sqrt{3}}v_3,\frac{1}{\sqrt{3}}v_1\} $ and
$M_B(s)=$diag$(1,1,-1)$
but I don't know how to get there.
You're almost there:
Similarly, $s(v_2,v_2)=2,\ s(v_3,v_3)=18$ so take $w_2=\frac1{\sqrt2}v_2$ and $w_3=\frac1{3\sqrt2} v_3$.