We look, for example, at the ellipse with equation
We would like to find the tangent lines with given slope $m$.
Such a line will have equation of the shape $y=mx+k$.
Substitute in the equation of the ellipse. After a little simplification, we get
We want this equation to have a "double root." That happens iff the discriminant is $0$. It is a nuisance to type the discriminant in this case, but recall that the discriminant of the quadratic polynomial $px^2+qx+r$ is $q^2-4pr$.
We end up with an equation for $k$, actually a very simple equation, since the discriminant condition gives us a linear equation for $k^2$.
Remark: There is a much nicer way, which I will not give the details of. Take the ellipse. Scale distances in the $y$ direction until you get a circle. Note what happens to the desired slope $m$ under the scaling. Now find the tangent lines using circle geometry properties. Scale back.