This is the formula expressing the distance in case of accelerated motion.
In most general form it looks like this s=s0+vt+at^2/2
In our case we assume that h is the height of the ball and h=0 on the ground. So h increases in vertical direction. Also we have acceleration due to gravity, which acts downwards, that's why we take a=-g
We take the term vt with "+" sign because a ball is projected upwards due to the statement.
We have h0 in the formula, because initial position of the ball due to vertical axis is not zero: a ball is projected upwards from the top of a tower, the hieght of the tower is
Hopefully, now it's clear.
from where did we get h=h0+vt-gt^2/2 ?