I do not get how this is 7pi/4 this is homework not a test and or quiz of any sort

If tanθ = -1, then, it is necessary that θ = 3π/4 or 7π/4, because only for these values
tan θ = -1.
However, cosθ > 0 and it is possible only for values of θ in the first quadrant and in the fourth quadrant of the coordinate system
Then, by considering the previous conditions, you can conlclude that θ = 7π/4 because only for this value of θ, tanθ = -1 and cosθ >0
θ = 7π/4