Since the secx and cosx are reciprocals, the right side of the equation simplifies to 1.
So, we just need to show that the left side of the equation also simplifies to 1:
-tan2x + sec2x = -sin2x/cos2x + 1/cos2x
= (1 - sin2x)/cos2x
= cos2x/cos2x
= 1