Use the kinematic equation Vf=Vi + a*t where Vf is final velocity, Vi is initial velocity, a is acceleration, and t is time.
We are given all of those values through the equation or by logic except for time. When an object reaches its maximum height, at that moment it is going 0 m/s. That is the final velocity. We are given initial velocity 7 m/s. The only acceleration acting on the object is the acceleration due to gravity, which is 9.8 m/s^2 downward, or -9.8 m/s^2.
Plug those values into the kinematic equation. (0 m/s) = (7 m/s) + (-9.8 m/s^s)*(t)
Solve for time
t = (-7 m/s)/(-9.8 m/2^s) = .714286 s
Now that we know time, we can plug it into another kinematic equation Xf - Xi = Vi*t + 1/2*a*t^2
We can use the same variables as earlier for Vi, a, and t. We know that the initial distance Xi is 0 so that gives us Xf - 0 = (7m/s)(.714286s)+1/2*(-9.8m/s^2)*(.714286s)^2 = 2.5 m