by far the most general method is
ax2 + bx + c = 0
then since its quadratic it will have two roots x1 and x2
formula for finding these roots is
x1= (-b - squareroot(b2 - 4ac))/2a
x2 = (-b + squareroot(b2-4ac))/2a

consider x2 - 4x + 4 = 0
here comparing this eqn with std eqn ax2 + bx + c =0
a =1
b = -4
c= 4

x1 and x2 can be found by substituting the values of a b and c in the above formula
x1 = (-(-4) -squareroot((-4)(-4) - 4*(1)(4)) / 2 * 1
here x1 =2
similarly using the formulae u can find x2= 2
if u havedoubts pm me