I am referring to the method of diagonalization in order to transform a matrix $ A $ into $ D $ using the formula $ \\ D = MAM^{-1} \\ $ where $ D $ is the diagonal matrix constructed using the eigenvalues of $ A $ as the main diagonal in an arbitrarily selected order, $ M $ is the modal matrix where each column is the eigenvector of the corresponding column in the diagonal matrix and $ A $ is the selected matrix.
Is there like a derivation of where it came from? I've stumbled upon multiple textbooks and they don't really explain where it came from but they do establish why it works.