Sam hits a golf ball from a elevated tee

First take a derivative,
[tex]\frac{d}{dx}-5t^2+10t+30=-10t+10=-10(t-1)[/tex]
Now compute the critical point where the slope is 0,
[tex]-10(t-1)=0\implies t-1=0\implies t=1[/tex]
And done.
The maximum height is at [tex]t=1[/tex] of [tex]h(1)=-5+10+30=35[/tex].
Hope this helps :)