Let's draw the triangle.
tan x = opposite divided by adjacent while sin x = opposite divided by hypotenuse
Because tan x° = 6 divided by g and sin x° = 6 divided by h, we can conclude that 6 is the length of the opposite side, g is the length of the adjacent side, and h is the length of the hypotenuse.
cos x ° = adjacent divided by the hypotenuse
So we know that cos x ° = g divided by h.