Since 0° < θ < 90°, you know that cos(θ) > 0.
Recall that
1 + tan²(θ) = sec²(θ)
and also that
sec(θ) = 1/cos(θ)
So if cos(θ) > 0, we also have 1/cos(θ) = sec(θ) > 0.
Then
sec(θ) = + √(1 + tan²(θ))
sec(θ) = √(1 + (7/8)²)
sec(θ) = √113 / 8
so that
cos(θ) = 1 / (√113 / 8) = 8 / √113