We have given point of a circle $A(0, 0)$ and two lines: $x+y+2=0 \text { and } x-y+4=0$. We should find equation of a circle that passes through the point $A$ and touches those two lines.
I started solving my making system of three quadratic equations with three unknowns , but this system seems to be very hard to be solvable. Here is what I got so far.
Since point $A$ lies on the circle: $(0 - p)^2 + (0 - q)^2 = r^2, p^2 + q^2 = r^2$. We use the condition for touching of line and circle $r^2(A^2 + B^2) = (Ap + Bq + C)^2$.
$$p^2 + q^2 = r^2\\2r^2 = (p+q+2)^2 \\ 2r^2 = (p-q+4)^2 $$
From here: $(p+q+2)^2 = (p-q+4)^2$. I'm stuck to solving this part since canceling the squares gives wrong and only one result.
If we cancel the squares we get $$p+q+2=p-q+4\\2q = 2\\q=1\\r^2 = p^2+1\\2p^2+2=(p+3)^2\\2p^2+2=p^2+6p+9\\p^2-6p-7=0\\p_1 = -1, p_2 = 7$$

Sketch of Solution:
Suppose that $C$ is a circle with center $c$ that touches both lines. Then, the distance from $c$ to both lines is the same. This implies that $c$ lines on an angle bisector of the two lines. (If the two lines are parallel, then the angle bisector bisects the angle at infinity, i.e., is half-way between the two lines). For any point on the angle bisector, there exists a circle that touches both lines.
In your case, you have two lines with slopes $\pm 1$ which intersect at $(-3,1)$. There are two bisectors, the lines $y=1$ and $x=-3$. Let's work with $y=1$. For any point on this line, i.e., $(t,1)$, you need the distance between $(t,1)$ and a point on one of these lines. The closest point on the line $y=x+4$ is the point of intersection of the line $y=x+4$ with the line $y=-x+(t+1)$, i.e., the line passing through the point $(t,1)$ perpendicular to the line $y=x+4$. The intersection point has $x$ coordinate $\frac{t-3}{2}$. From here, the $y$ coordinate is $\frac{t+5}{2}$, and the radius of the circle with center $(t,1)$ is the distance between $(t,1)$ and $\left(\frac{t-3}{2},\frac{t+5}{2}\right)$. Now, do the same thing with the other bisector.
Finally, you need the condition that the circle contains $(0,0)$, i.e., the point $A$. What you need now is that the radius of the circle equals the distance between $(t,1)$ and the origin. This results in a univariate polynomial equation, which must be solved.