Example 6 In the quadrilateral pyramid $S-ABCD$, the side length of the square base $ABCD$ is $a$, and the side edges $SA=SB=SC=SD=2a$, $M$ and $N$ are the midpoints of edges $SA$ and $SC$ respectively. Find the distance $d$ between the skew lines $DM$ and $BN$ and the cosine value of the angle $\alpha$ they form.
Solution: Taking the center $O$ of the square base as the origin, establish a rectangular coordinate system as shown in Figure 5, then
$$
\begin{array}{l}
B\left(\frac{a}{2},-\frac{a}{2}, 0\right), \\
D\left(-\frac{a}{2}, \frac{a}{2}, 0\right), \\
M\left(-\frac{a}{4},-\frac{a}{4}, \frac{\sqrt{14} a}{4}\right), \\
N\left(\frac{a}{4}, \frac{a}{4}, \frac{\sqrt{14} a}{4}\right) .
\end{array}
$$

Thus, $B N=\left(-\frac{a}{4},-\frac{3 a}{4}, \frac{\sqrt{14} a}{4}\right)$,
$$
D M=\left(\frac{a}{4},-\frac{3 a}{4}, \frac{\sqrt{14} a}{4}\right) .
$$

Let $\boldsymbol{n}=(x, y, z)$ be a direction vector of the common perpendicular to $D M$ and $B N$. From $\boldsymbol{B N} \cdot \boldsymbol{n}=0, \boldsymbol{D M} \cdot \boldsymbol{n}=0$, we get $\boldsymbol{n}=(3,1,0)$.
Since $M N=\left(\frac{a}{2}, \frac{a}{2}, 0\right)$, the distance $d$ between the skew lines $D M$ and $B N$ is $d=\frac{|M \boldsymbol{M} \cdot \boldsymbol{n}|}{|\boldsymbol{n}|}=\frac{\sqrt{10} a}{5}$. Also, $|B N|=|D M|=\frac{\sqrt{6} a}{2}$, therefore,
$$
\cos \alpha=\frac{|B N \cdot D M|}{|B N||D M|}=\frac{1}{6} .
$$