Theorem (rational canonical form)
Let $V$ be a vector space over $\mathbb{F}$, and fix an endomorphism $α$, giving an $\mathbb{F}[X]$-module $V_α$.
If $V$ is finite-dimensional, then $$ \begin{align*} V_α \isom \mathbb{F}[X]/(f_1) \oplus \ldots\oplus \mathbb{F}[X]/(f_r) \end{align*} $$ where $f_i\neq 0$ and $f_i\mid f_{i+1}$.
This gives a basis for $V$ where the matrix of $α$ has the block diagonal matrix $$ \begin{align*} \pmat{c(f_1) \\ & \ddots \\ && c(f_r)} \end{align*} $$ where $c(f_i)$ is the companion matrix of $f_i$: if $f = a_0 + a_1 X + \ldots + a_{d-1} X^{d-1} + X^d$, then $$ \begin{align*} c(f) = \pmat{0 &&&& -a_0 \\ 1 &&&& -a_1 \\ &1 &&& -a_2 \\ &&\ddots&&\vdots \\ &&&1 & -a_{d-1}}. \end{align*} $$