Let's start by looking at a generic quadratic function in vertex form:
y = a(x-h)2+b
Notice if x = h, then the function becomes y = b. This is either the minimum or maximum of the function with a vertex at (h,b).
if x = 0, then the function becomes y = ah2 + b. This is the y intercept!
So putting it together...
If the vertex is (5,4) then this corresponds to (h,b). h = 5 and b = 4.
Plug these numbers back into the original equation:
y = a(x-5)2 + 4
Now, substitute the y intercept, y = 2, (when x=0) and solve for a:
2 = a(0-5)2 + 4
2 = a(52) + 4
2 = 25a + 4
a = (-2/25)