The state is the smallest set of variables that, with the input, fully determines the future behaviour. A linear time-invariant state model is
$$\dot{\mathbf x} = A\mathbf x + B\mathbf u, \qquad \mathbf y = C\mathbf x + D\mathbf u$$
From a differential equation (phase variables)
For $\dddot y + a_2\ddot y + a_1\dot y + a_0y = u$, choose $x_1 = y$, $x_2 = \dot y$, $x_3 = \ddot y$:
$$A = \begin{bmatrix}0&1&0\\0&0&1\\-a_0&-a_1&-a_2\end{bmatrix},\ B = \begin{bmatrix}0\\0\\1\end{bmatrix},\ C = \begin{bmatrix}1&0&0\end{bmatrix}$$
From a circuit
Choose capacitor voltages and inductor currents as state variables, since they describe the stored energy.
State space to transfer function
$$G(s) = C(sI - A)^{-1}B + D$$
The eigenvalues of $A$ (roots of $|sI - A| = 0$) are the poles of the system.