How to find transformation matrix which converts matrix to simple standard form I have a matrix A$$  \left( \begin{array}{ccc}
0 & 1 \\
a^2 & 0\\
\end{array} \right) $$
Using eigen values, I convert it into simple standard form B:
$$\left( \begin{array}{ccc}
a & 0 \\
0 & -a\\
\end{array} \right) $$
How can I find the transformation matrix M which converts this to simple standard form. In other words, how to find M such that $MAM^{-1}=B$. I am actually interested in knowing the nature of the transformation. Also in general how does one find it?

If $a \ne 0$, the eigenvalues of $A$ are $\pm a$; this is tacitly given in the problem, by stipulating the diagonalized form of $A$, $B$, is diagonal with diagonal entries $a$, $-a$, but it is also easy to see since the characteristic polynomial of $A$ is
$\det (A - \lambda I) = (-\lambda)^2 - a^2 = \lambda^2 - a^2; \tag{1}$
the roots are clearly $\lambda = \pm a$.  Since they are distinct, the corresponding eigenectors are linearly independent; we can in fact almost without effort write them down; indeed, direct calculation reveals that
$A \begin{pmatrix} 1 \\ a \end{pmatrix} = \begin{pmatrix} a \\ a^2 \end{pmatrix} = a \begin{pmatrix} 1 \\ a \end{pmatrix} \tag{2}$
and
$A \begin{pmatrix} 1 \\ -a \end{pmatrix} = \begin{pmatrix} -a \\ a^2 \end{pmatrix} = -a \begin{pmatrix} 1 \\ -a \end{pmatrix}; \tag{3}$
one can also validate the linear independence of $v_a = (1, a)^T$ and $v_{-a} = (1, -a)^T$ directly; this is an easy exercise working from the definitions so I leave it to the reader.  Suppose we set up the matrix
$E = \begin{bmatrix} 1 & 1 \\ a & -a \end{bmatrix} = \begin{bmatrix} v_a & v_{-a} \end{bmatrix}; \tag{4}$
i.e., the columns of $E$ are the eigenvectors of $A$.  Then it is easy to see that
$AE = \begin{bmatrix} Av_a & Av_{-a} \end{bmatrix} = \begin{bmatrix} a v_a & -a v_{-a} \end{bmatrix}. \tag{5}$
We next observe that, the columns of $E$ being linearly independent, $E$ is nonsingular, so we have $E^{-1}$ with
$E^{-1} \begin{bmatrix} v_a & v_{-a} \end{bmatrix} = \begin{bmatrix} E^{-1} v_a & E^{-1} v_{-a} \end{bmatrix} = I, \tag{6}$
i.e.,
$E^{-1} v_a = \begin{pmatrix} 1 \\ 0 \end{pmatrix} \tag{7}$
and
$E^{-1} v_{-a} = \begin{pmatrix} 0 \\ 1 \end{pmatrix}. \tag{8}$
Thus
$E^{-1}AE = E^{-1}  \begin{bmatrix} Av_a & Av_{-a} \end{bmatrix} = \begin{bmatrix} a E^{-1}(v_a) & -a E^{-1}(v_{-a}) \end{bmatrix} = \begin{bmatrix} a & 0 \\ 0 & -a \end{bmatrix}. \tag{9}$
We see the matrix $E$ of eigenvectors of $A$ diagonalizes $A$ via the prescription
$A \to E^{-1}AE$; if one really needs the answer to read $MAM^{-1}$, simply set $M = E^{-1}$ so that $M^{-1} = E$ and proceed from there.
This technique obviously generalizes to matrices of any size $n$, as long as there are $n$ linearly independent eigenvectors, which will always be the case if the eigenvalues are distinct.  Finally, we note that the case $a = 0$ is tacitly excluded by the question itself, since $A$ then becomes nilpotent and can't be diagonalized.
Hope this helps.  Cheers,
and as always,
Fiat Lux!!!
