The first thing to do is draw a diagram to visualise the problem. Next we write down all the information the question gives us as well as which values we want to find. For this question it would be S=5m, U=20sin(30), V=/, A=-9.81m/s/s, T=?. We can see that the positive direction was chosen to be up which is why the acceleration due to gravity is negative.
Next we select which SUVAT equation to use. The one we want is s=ut+0.5at2 as it doesn't contain a v. Plugging all the numbers in we get 5=20sin(30)t-0.59.81t2.
As this a quadratic we can apply the quadratic formula of x = (-b+-sqrt(b2-4ac))/2a. This gives us 2 values for the time which makes sense as from the diagram we can see that there are 2 points in the balls journey where it is 5m above the ground. The values obtained are t=1.160s and t=0.879s.
Next we use these values to work out how far the ball had moved in the x direction at these points. For that we use the equation s=ut and resolve the velocity in the horizontal direction (u=20cos(30)). This gives us values of s1=20.1m and s2=15.2m which are the possible positions of the wall.