I am having problems understanding how to extract this information into a formula.
A 10-foot wall stands 5 feet from a building. A ladder, supported by the wall, touches a building. Express the length of the ladder as a function of x
(Note: i do have have the answer to the question, my question is on how to extract the information)
Any help would be much appreciated, Cheers!

By the Pythagorean Theorem, we get: $L=\sqrt{y^2+(x+5)^2}$.
Now, we have to find a way to express $y$ in terms of $x$.
Notice that the two triangles in the diagram are similar triangles. This means that the ratio of two sides in the first triangle has to be equal to the ratio of the corresponding sides in the second triangle:
$$\frac{x}{10}=\frac{x+5}{y}$$
By cross-multiplication, we find: $y=\frac{10(x+5)}{x}$.
Hence, we can express the length of $L$ by:
$$L=\sqrt{\bigg(\frac{10(x+5)}{x}\bigg)^2+(x+5)^2}$$