The Pythagorean identity states that ##sin^2theta+cos^2theta=1##.
We can rearrange the identity to see that ##cos^2theta=1-sin^2theta##.
If we know that ##cos^2theta=1-sin^2theta## we can replace ##cos^2theta## with ##1-sin^2theta## in the expression ##cos^2theta-sin^2theta##.
##cos^2theta-sin^2theta=(1color(blue)(-sin^2theta))color(blue)(-sin^2theta##
Combine like terms to see that:
##cos^2theta-sin^2theta=1-2sin^2theta##