Make sure your calculator is in degrees mode before using any trig functions.
There are three possible functions:
tan(theta)= opposite/adjacent
cos(theta)= adjacent/hypotenuse
sin(theta)= opposite/hypotenuse
Since we are using the hypotenuse in this case, the tan equation is useless. Either one of the other two will work, but I chose to use the sin equation. I find it helps to draw a picture of the triangle and label it with the givens. The opposite side is determined by theta, which in this case is 45 either way, but I elected to make the vertical leg the opposite leg and the horizontal leg the adjacent leg. Note that this is not always the case, and it is not always possible to just choose like this.
sin(theta)= opposite/hypotenuse
sin(45)= o/18
12.728 cm