A matrix is diagonalizable if and only if there exist a "complete set" of eigenvectors. (Your "algebraic and geometric multiplicities are equal". The algebraic multiplicity is the size of the matrix, the geometric multiplicity is the number of independent eigenvectors.) Specifically, if the matrix represents a linear transformation on vector space U, then, in order to be "diagonalizable", there must exist a basis for U consisting of eigenvectors of the linear transformation. You construct the matrix representing a linear transformation, in a given basis, by applying the transformation to each basis vector in turn, writing the result as a linear combination of basis vectors. The coefficients give each column of the matrix.
If all the basis vectors \{v_1, v_2, \cdot\cdot\cdot\, v_n\} are eigenvectors, that is, if Lv_1= \lambda_1v_1, Lv_2= \lamba_2v_2, \cdot\cdot\cdot, Lv_n= \lambda_nv_n, then each column consists of the eigenvalue, in the appropriate position, and "0"s:
\begin{bmatrix}\lambda_1 & 0 & \cdot & \cdot & \cdot & 0 \\ 0 & \lambda_2 & \cdot & \cdot\ & \cdot & 0 \\ \cdot & \cdot\ & \cdot\ & \cdot & \cdot & \cdot \\ 0 & 0 & \cdot & \cdot & \cdot & \lambda_n\end{bmatrix}