Cos is adjacent/hypotnuse meaning that 3 is the 'adjacent' and 5 would be the hypotenuse. Using the Pythagorean Theorem (of the knowledge of Pythagorean Triples), you find that the other side of the right triangle is 4. Tan is opposite/adjacent. 'Opposite' would be 4, and 'adjacent' would remain 3. That means that tan B is 4/3.