Example 2 Given a cube $A B C D-A_{1} B_{1} C_{1} D_{1}$ with edge length 2, connect $D_{1} A$, $D_{1} B$, $E$ is the midpoint of $D_{1} B$, $F$ is the midpoint of $B C$, $G$ is the midpoint of $A D_{1}$, find the size of the angle formed by the skew lines $D G$ and $E F$.
Solve As shown in Figure $15-2$, establish a spatial rectangular coordinate system, then
$$
\begin{array}{l}
O(0,0,0), A(2,0,0), B(2,2,0), C(0,2,0), \\
D(0,0,2), F(1,2,0), E(1,1,1), G(1,0,1) .
\end{array}
$$

Thus, $\overrightarrow{E F}=\{0,1,-1\}, \overrightarrow{D G}=\{1,0,1\} \cdot \cos \theta=$
$$
\frac{\overrightarrow{E F} \cdot \overrightarrow{D G}}{|\overrightarrow{E F}| \cdot|\overrightarrow{D G}|}=\frac{0+0-1}{\sqrt{0+1+1} \cdot \sqrt{1+0+1}}=-\frac{1}{2} \text {, }
$$

Therefore, $\theta=120^{\circ}$, which means the angle formed by the skew lines $D G$ and $E F$ is $60^{\circ}$.