recall your SOH CAH TOA, or [tex]\bf sin(\theta)=\cfrac{opposite}{hypotenuse}
\qquad \qquad
% cosine
cos(\theta)=\cfrac{adjacent}{hypotenuse}
\\ \quad \\\\
% tangent
tan(\theta)=\cfrac{opposite}{adjacent}[/tex]
now, bear in mind that, the opposite side, to an angle, is the side right "in front of it", that is, if you were to put your eye on that angle, "the wall" you'd see on the other end, is the opposite side
the adjacent side, adjacent = next to, is the side that's touching the angle itself
and the hypotenuse, is always the slanted and longest side of all three
for example on 16, tangent of Z
if you put one eye on Z, you'll see on the other end, the side of 30 units
the adjacent side is the one touching Z, or the 40 units side
[tex]\bf tan(\theta)=\cfrac{opposite}{adjacent}\implies tan(Z)=\cfrac{30}{40}
\\\\\\
\textit{which can be simplified to }\cfrac{3}{4}
[/tex]
and you'd do all others, the same way, using those ratios
use [tex]\bf sin(\theta)=\cfrac{opposite}{hypotenuse}
\qquad \qquad
% cosine
cos(\theta)=\cfrac{adjacent}{hypotenuse}
\\ \quad \\\\
% tangent
tan(\theta)=\cfrac{opposite}{adjacent}[/tex]