For this you just look at the sides.
Soh cah toa
This is good to remember.
Sin = opposite/ hypotenuse
Cos= adjacent/ hypotenuse
Tan = opposite/ adjacent
In this case you have TanZ, the side adjacent to the angle is 10 and the opposite to the angle is 24. So tanZ is 24/10 which simplifies to 12/5.
The hypotenuse is always the longest side, but the opposite and adjacent sides can change depending on the angle.