The 4 feet from the wall is the bottom part of the triangle. The 10 ft. ladder is the hypotenuse of the triangle. Use the Pythagorean Theorem and substitute the known values.
a^2+b^2=c^2
4^2+b^2=10^2
Then square all the known values
16+b^2=100
Then get b by itself
b^2=-16+100
add -16 and 100
b^2=84
and finally square root both sides of the equation