Example 2. Calculate $\left|\begin{array}{lll}1 & \cos \alpha & \cos \beta \\ \cos \alpha & 1 & \cos (\alpha+\beta) \\ \cos \beta & \cos (\alpha+\beta) & 1\end{array}\right|$.
$$
\begin{aligned}
\text { Original expression }= & 1+2 \cos \alpha \cos \beta \cos (\alpha+\beta)-\cos ^{2} \beta \\
& -\cos 2 \alpha-\cos ^{2}(\alpha+\beta) \\
= & 1+\cos (\alpha+\beta)[2 \cos \alpha \cos \beta \\
& -\cos (\alpha+\beta)]-\cos ^{2} \alpha-\cos ^{2} \beta \\
= & 1+\cos (\alpha+\beta) \cos (\alpha-\beta) \\
& -\cos ^{2} \alpha-\cos ^{2} \beta \\
= & 1+\cos ^{2} \alpha-\sin ^{2} \beta-\cos ^{2} \alpha-\cos ^{2} \beta \\
= & 1-\left(\sin ^{2} \beta+\cos ^{2} \beta\right)=0 .
\end{aligned}
$$

Note: When solving problems using the "difference of squares" formula, pay attention to the reverse application of the formula.