The base, height and diagonal form a right triangle with the diagonal being the hypotenuse ( draw a picture and you will see this) So you can use Pythagorean theorem to solve
5^2 +x^2 = 13^
25 +x^2 = 169
x^=144
x =12
You could also recognize this as a Pythagorean triple 5-12-13 which would save you having to do the computation