If $(p| 11) = 1,$ then the Legendre symbol $(-11|p) = 1.$ We can solve $\beta^2 \equiv -11 \pmod p.$ By choosing either $\beta$ or $p - \beta,$ because this time we need $\beta$ odd, we can solve $\beta^2 \equiv -11 \pmod {4p}.$ That is, $\beta^2 = -11 + 4pt$ for some integer $t.$
So far, we have the binary quadratic form $\langle p, \beta, t \rangle,$ or
$$ f(x,y) = px^2 + \beta xy + t y^2, $$
of discriminant $-11.$
We apply Gauss reduction to get a reduced form; inequalies show that the only reduced form of discriminant $-11$ is $\langle 1, 1, 3 \rangle.$ The 2 by 2 integer matrix $P$ of determinant $1$ that took us from $\langle p, \beta, t \rangle$ to $\langle 1, 1, 3 \rangle$ has an inverse of integers, $P^{-1}.$ The left hand column of $P^{-1}$ shows how to represent $p$ as $x^2 + xy + 3y^2.$
Let's see; we find $P$ one step at a time. In the end, though, we have
$$ P^T G P = H, $$
where
$$ G =
\left(
\begin{array}{rr}
p & \frac{\beta}{2} \\
\frac{\beta}{2} & t
\end{array}
\right)
$$
and
$$ H =
\left(
\begin{array}{rr}
1 & \frac{1}{2} \\
\frac{1}{2} & 1
\end{array}
\right)
$$
If we name $Q = P^{-1},$ we have
$$ Q^T H Q = P. $$