You have that sin x = 4/5, which means that the hypotenuse of a triangle is 5 and the opposite side to x has a length of 4.
By using the Pythagorean Theorem you have:
h² = c1² + c2²
where h = 5 and c1 = 4. Solve the previous equation for c1:
c2² = h² - c1²
c2² = 5² - 4²
c2² = 25 - 16
c2² = 9
c2 = 3
next, take into account that cos x is given by the quotient of the adjacent side c2 over the hypotenuse h:
cos x = c2/h = 3/5
Hence, cos x = 3/5