my attempt ; first i was taking $P = \operatorname{id}_3$..this was not satisfied and after that i was trying in taking some upper triangular matrix ,but i could not get the matrix who satisfied the $PAP^{-1} = B$
Im confused ..PLiz help me ,,and tell me the solution

Let$$e_1=\begin{bmatrix}1\\0\\0\end{bmatrix}\text{, }e_2=\begin{bmatrix}0\\1\\0\end{bmatrix}\text{, and }e_3=\begin{bmatrix}0\\0\\1\end{bmatrix}.$$Then
Do you see how similar they are?
So, take$$P=\begin{bmatrix}0&1&0\\1&0&0\\0&0&1\end{bmatrix}.$$The matrix $P$ (which is clearly orthogonal) was chosen so that $P.e_2=e_1$, $P.e_1=e_2$, and $P.e_3=e_3$. So, $P.A.P^{-1}=B$, as you wanted.