I'm a student and do my homework.
My $4\times 4$ matrix:
$$ A=
\begin{bmatrix}
0 & 4 & -1 & -1 \\
-1 & 4 & 0 & -1 \\
0 & 0 & 2 & 0 \\
0 & 0 & 0 & 2
\end{bmatrix}
$$
The characteristic polynomial is $(2-\lambda)^4$, so there are $4$ equal eigenvalues $\lambda=2$, and its algebraic and geometric multiplicities are
\begin{align*}
\operatorname{am}_A(2) &= 4 & \operatorname{gm}_A(2) &= 2
\end{align*}
After all, I know that the Jordan form is $4\times 4$ matrix with $\lambda=2$ on the main diagonal and there are $2$ Jordan blocks. So it looks like this but instead of $x$ it should have either $0$ or $1$. Here is the first issue.
$$
\begin{matrix}
2 & x & x & 0 \\
0 & 2 & x & x\\
0 & 0 & 2 & x\\
0 & 0 & 0 & 2 \\
\end{matrix}
$$
Also I need to find a transition matrix $P$ such that $J=P^{-1}AP$. As far as I understand it's a $4\times 4$ matrix whose columns are eigenvectors of the initial matrix $A$. So $2$ of the columns of $P$ are $u_1 = (-1, 0, 0, 0)^{T}$ and $u_2 = (0, 0, 1, 0)^{T}$. How to find the other $2$ columns?
PS I'm not asking for an exact answer (have Wolfram for it), but try to understand how to do it on my own.
Hint As you've observed, the geometric multiplicity of the (sole) eigenvalue $2$ is $2$, so the Jordan canonical form has exactly $2$ Jordan blocks, leaving just two possible Jordan canonical forms: $$J_3(2) \oplus J_1(2) \qquad \textrm{and} \qquad J_2(2)\oplus J_2(2).$$ In these cases, the minimal polynomial of $A$ is, respectively, $(t - 2)^3$ or $(t - 2)^2$. What happens when you (formally) evaluate those two polynomials at $A$?
For a defective matrix $n \times n$ like ours, there are fewer than $n$ linearly independent eigenvectors. So, we constructing the transition matrix, instead of picking a basis of eigenvectors, for each Jordan block $J_k(\lambda)$ we must find a vector ${\bf v}$ satisfying $(A - \lambda I)^k {\bf v} = {\bf 0}$ but $(A - \lambda I)^{k - 1} {\bf v} \neq {\bf 0}$. Then, for the columns of the transition matrix corresponding to that block we can take the vectors $$A^{k - 1} {\bf v}, \ldots, A {\bf v}, {\bf v}.$$