Let $A\in\mathcal{M}_{n}(K)$, where $K$ is a field. Then, we can obtain the characteristic polynomial of $A$ by simply taking $p(\lambda)=\det(A-\lambda I_n)$, which give us something like
$$p(\lambda) = (-1)^n\lambda^n + (-1)^{n-1}(\text{tr } A)\lambda^{n-1} + \cdots + \det A$$
Now, how can we obtain the matrix $A$ knowing the characteristic polynomial?
Any two similar matrices $B = P A P^{-1}$ will have the same characteristic polynomial. Also $A$ and $A^T$ have the same characteristic polynomial.
While the matrix $A$ which has a given characteristic polynomial is not unique, it is often convenient to choose an upper Hessenberg matrix called the (Frobenius) companion matrix or its (lower Hessenberg) transpose.
That is, the $n\times n$ matrix:
$$ \begin{bmatrix} 0 & 0 & \ldots & 0 & -c_0 \\ 1 & 0 & \ldots & 0 & -c_1 \\ 0 & 1 & \ldots & 0 & -c_2 \\ \vdots & \vdots & \ddots & \vdots & \vdots \\ 0 & 0 & \ldots & 1 & -c_{n-1} \end{bmatrix} $$
has characteristic polynomial $p(x) = x^n + c_{n-1}x^{n-1} + \ldots + c_1 x + c_0$.
One approach to finding the roots of a polynomial is to apply eigenvalue solvers to the companion matrix for the polynomial.