Approach
We seek to make a substitution that removes the square root in the denominator via the use of a trig identity. Letting #A# and #B# each be some trig function (e.g. #sin# or #sec#), we seek an identity such that #B^2(x)=A^2(x)-1#. One such is #tan^2(x)=sec^2(x)-1#, obtained by dividing through the identity #sin^2(x)+cos^2(x)=1# by #cos^2(x)#.
Note that we might have an easier time of the later integration if we used hyperbolic functions instead - we could use #cosh^2(x)-1=sinh^2(x)# instead. But the question asks for a trig substitution, so we'll use the #tan#-#sec# identity above. I'll supply the hyperbolic substitution suggestion underneath, for your interest. If the hyperbolic functions are new to you, have a read of the Wikipedia article on them: https://en.wikipedia.org/wiki/Hyperbolic_function
They are both interesting and useful, as well as surprisingly easy to deal with. Knowing about them will enrich your knowledge of the trig functions.
Trig substitution and solution
Substitute #x=2sectheta#, so #dx/(d theta)=2secthetatantheta#, by an application of the quotient rule. Thus
#int (2-x^2)/sqrt(x^2-4)dx=int (2-4sec^2theta)/sqrt(4sec^2theta-4) *2secthetatantheta d theta#
(Use the above identity)
#=int (2-4sec^2theta)/sqrt(4tan^2theta) *2secthetatantheta d theta#
#=2int (2-4sec^2theta)/(2tantheta) secthetatantheta d theta#
#=2int (1-2sec^2theta) sectheta d theta=2int sec theta-2sec^3theta d theta#
The integrals of both #sectheta# and #sec^3theta# are derived here: https://www.math.ubc.ca/~feldman/m121/secx.pdf
We'll just take the results:
#intsecthetad theta=ln |sectheta+tantheta|+C#
#intsec^3thetad theta=1/2secthetatantheta+1/2ln|sectheta+tantheta|+C#
So, for our integral
#2int sec theta-2sec^3theta d theta=#
#2ln|sectheta+tantheta|-2secthetatantheta-2ln|sectheta+tantheta|+C=#
#-2secthetatantheta+C=#
#-2secthetasqrt(sec^2theta-1)+C#
Substitute back to our original variable #x#:
#-2*1/2xsqrt(1/4x^2-1)+C=#
#-x/2sqrt(x^2-4)+C#
Alternative solution using hyperbolic substitution
As I mentioned this above as an alternative approach, let's work it through to give you more info on ways to attack such problems.
Instead of substituting #x=2sectheta# as above, substitute #x=2coshu#. Then #dx/(du)=2sinhu#.
#int (2-x^2)/sqrt(x^2-4)dx=int (2-4cosh^2u)/sqrt(4cosh^2u-4) *2 sinhu d theta#
#=2int (2-4cosh^2u)/sqrt(4sinh^2u) sinhu d theta#
#=2int (2-4cosh^2u)/(2sinhu) sinhu d theta#
#=2int 1-2cosh^2u d theta#
This is where we see how the hyperbolic approach produces easier working - this is an easier integral than the #2intsectheta-2sec^3theta d theta# that the trig substitution produced. Continuing, using the identity #1-2cosh^2u=-cosh2u#
#2int 1-2cosh^2u du=-2int cosh2udu#
#=-sinh2u+C=-2sinhucoshu+C=-2coshusqrt(coshu^2-1)+C#
Substitute back to our original variable #x#:
#-2x/2sqrt((x/2)^2-1)+C=#
#-x/2sqrt(x^2-4)+C#, as before, but with less awkward working in the integral.
Moral
When presented with an integral of a fraction with a square root denominator of a quadratic, it's always worth taking a moment to think about which particular trig or hyperbolic substitution will make for the easiest route to the answer. There's usually more than one option, and some will be harder work than others. If you can avoid using #tan#s and #sec#s by employing #sinh#s and #cosh#s, it's almost always a good idea to do so. Unless, of course, the question-setter specifically requests that your solution uses a trig substitution!