Computing the Jordan Form of a Matrix
Step 1: find eigenvalues. $\chi_A(\lambda) = \det(A-\lambda I) = -\lambda^3+5\lambda^2-8\lambda+4 = -(\lambda-1)(\lambda-2)^2$. We are lucky, all eigenvalues are real.
Step 2: for each eigenvalue $\lambda_\imath$, find rank of $A-\lambda_\imath I$ (or, rather, nullity, $\dim(\ker(A-\lambda_\imath I))$) and kernel itself. For $\lambda=1$: $$A-\lambda I = \pmatrix{-8 && 8 && 2 \\ -4 && 4 && 1 \\ -23 && 21 && 6}, \ker(A-\lambda I) = L(\pmatrix{3 \\ 1 \\ 8})$$ Algebraic multiplicity of the root is 1, geometric multiplicity is 1, we're done here. For $\lambda=2$: $$A-\lambda I = \pmatrix{-9 && 8 && 2 \\ -4 && 3 && 1 \\ -23 && 21 && 5}, \ker(A-\lambda I) = L(\pmatrix{2 \\ 1 \\ 5})$$ Algebraic multiplicity of the root is 2, geometric multiplicity is 1. We're unlucky, now we have to solve $$(A-\lambda I)v=\pmatrix{2 \\ 1 \\ 5} \sim v = \pmatrix{0 \\ 0 \\ 1}$$ Step 3: our matrix in basis $(\pmatrix{3 \\ 1 \\ 8},\pmatrix{2 \\ 1 \\ 5},\pmatrix{0 \\ 0 \\ 1})$ has form $J_A = \pmatrix{1 && 0 && 0 \\ 0 && 2 && 1 \\ 0 && 0 && 2}$. Matrix $P$ corresponding to this basis change is $\pmatrix{3 && 2 && 0 \\ 1 && 1 && 0 \\ 8 && 5 && 1}$, i.e. $P^{-1}AP=J_A$.
If you are not interested in computing $P$, then the Jordan form can be computed by using this:
The number of Jordan blocks with diagonal entry as $\lambda$ is the geometric multiplicity of $\lambda$.
The number of Jordan blocks of order $k$ with diagonal entry $\lambda$ is given by $rank(A-\lambda I)^{k-1}-2\, rank(A-\lambda I)^k + rank(A-\lambda I)^{k+1}.$
Here, the geometric multiplicities of $\lambda =1,2$ are each $1.$ And $1$ has algebraic multiplicity $1$ where as of $2$ the algebraic multiplicity is $2.$ So, using the condition (1) only, we see that there is a Jordan block of order $1$ with $\lambda=1$ and one Jordan block with $\lambda=2.$. So, the Jordan form is as computed above. (of course, upto a permutation of the Jordan blocks.)