This is a SOH-CAH-TOA problem, or trigonometry! Take a look at the attached image for a sketch of this problem.
(a) To find the distance up the wall, we'll need to use the sine function. This is because we know the angle is opposite the wall and we also know the hypotenuse.
sin(58.5) = x/4
x = (4)(sin(58.5)) ---> Plug this into your calculator to get the answer! And make sure your calculator is in degrees if that is an option.
x = 3.4 meters
(b) To find the distance between the foot of the ladder and the wall, we'll need to use the cosine function. This is because we know the angle is adjacent to the wall and we also know the hypotenuse.