SOH CAH TOA tells you
... cos(B) = a/c
... 4/5 = 8/c
... c = 10 . . . . . multiply by 5c/4
By the Pythagorean theorem,
... b = √c² -a²) = √(10² -8²) = √36 = 6
The lengths of the other two sides are: b = 6, c = 10.
_____
You can tell from the value of the cosine that this is a 3-4-5 right triangle. You can tell from the value of "a" that the scale factor is 2. That means the other two sides are 6 and 10.