Recall the Pythagorean identity,
[tex]\tan^2\theta+1=\sec^2\theta[/tex]
[tex]\sec\theta[/tex] is the reciprocal of [tex]\cos\theta[/tex]. In a right triangle, the non-right angles are always acute, so [tex]\cos\theta[/tex] would be positive for either of them. This means
[tex]\dfrac1{\cos^2\theta}=\tan^2\theta+1\implies\cos^2\theta=\dfrac1{\tan^2\theta+1}\implies\cos\theta=\dfrac1{\sqrt{\tan^2\theta+1}}[/tex]
We have [tex]\tan\theta=\frac65[/tex], so
[tex]\cos\theta=\dfrac1{\sqrt{\left(\frac65\right)^2+1}}=\dfrac5{\sqrt{61}}[/tex]