$x^2 + 5 y^2 $ represents primes $p=5$ or $p \equiv 1,9 \pmod {20}.$
The other form of that discriminant, $2x^2 + 2 x y + 3 y^2,$ represents $p=2$ and $p \equiv 3,7 \pmod {20}.$
For $p \neq 2,5,$ we have Legebdre symbol $(-20|p) = 1$ when $p \equiv 1,3,7,9 \pmod {20}.$ Given such a prime, we solve
$$ \beta^2 \equiv -20 \pmod p $$
If $\beta $ is odd, replace it by $p-\beta$ which is even. So we have now
$$ \beta^2 \equiv -20 \pmod {4p}. $$ This is
$$ \beta^2 = -20 + 4 p t $$ for some integer $t,$ or
$$ \beta^2 - 4 p t = -20. $$
So, the binary quadratic form $$ \langle p, \beta, t \rangle $$
has the correct discriminant. Gauss reduction takes this to either $ \langle 1,0,5 \rangle $ or $ \langle 2,2,3 \rangle. $ We can tell which one by $(5|p).$
Let's see; reduction is a step by step procedure for taking the Hessian matrix $H$ (second partial derivatives) of the original form to one of the choices, either diagonal with entries $(2,10)$ because of the doubling, or the other one. The resulting matrix equation is $P^T H P = G,$ where $P \in SL_2 \mathbb Z.$ But then $P^{-1}$ has also all integer entries, call it $Q = P^{-1}, $ and we have $Q^T G Q = H.$ The representation of $p$ is the left column of $Q.$