If I have a matrix with distinct eigenvalues, why can't I just write a matrix with those as diagonal elements, but I have to do the procedure $P^{-1}AP$?
Also I have found this question too that seems to support what I say, but then why in books there is this whole procedure?
A diagonalization of a matrix $A$ is a decomposition as $A=PDP^{-1}$ for $P$ a change of basis matrix, $D$ a diagonal matrix, and $A$ the original matrix. Suppose we know that $$ \mathbb{R}^n=\bigoplus_{i=1}^kE(\lambda_i,A)$$ where $E(\lambda_i,A)$ is the eigenspace of $A$ corresponding to $\lambda_i$, and $\lambda_1,\ldots,\lambda_k$ are the distinct eigenvalues. Then we can immediately recover the diagonal matrix $D$ as having a diagonal consisting of $\lambda_1,\ldots \lambda_k$ with $\lambda_i$ appearing $\dim E(\lambda_i,A)$ times. However, in practice you won't have this much information.
Long story short its mostly a matter of what information you need to gather and what information you have. Sometimes you'll be more interested in the matrix $P$.