Per definition a matrix $A$ is diagonalisable if there exists a matrix S such that $S^{-1}AS$ is a diagonal matrix.
My question is how do I find the matrix $S$? Is it always the combination of the vectors that span the eigenspaces of the matrix $A$ or how can I find $S$?