Example 4 Given ten points in space, where no four points lie on the same plane. Connect some of the points with line segments. If the resulting figure contains no triangles and no spatial quadrilaterals, determine the maximum number of line segments that can be drawn.
Let the ten points be $A_{1}, A_{2}, \cdots, A_{10}$. Using these ten points as vertices and the line segments connecting them as edges, we obtain a simple graph $G$ of order 10. Let the degree of point $A_{i} (i=1,2, \cdots, 10)$ be $d_{i}$. Then the total number of edges in graph $G$ is $\frac{1}{2} \sum_{i=1}^{10} d_{i}$.

In graph $G$, we call the figure formed by two line segments sharing a common endpoint an angle. Thus, there are $\sum_{i=1}^{10} \mathrm{C}_{d_{i}}^{2}$ different angles.

By the given condition, for any angle $\angle A_{i} A_{j} A_{k}$ in graph $G$, $A_{i}$ and $A_{k}$ are not adjacent. For any two angles $\angle A_{i_{1}} A_{j_{1}} A_{k_{1}}$ and $\angle A_{i_{2}} A_{j_{2}} A_{k_{2}}$, we have
$\left\{A_{i_{1}}, A_{k_{1}}\right\} \neq\left\{A_{i_{2}}, A_{k_{2}}\right\}$.
Thus, the complement graph of $G$ has at least $\sum_{i=1}^{10} \mathrm{C}_{d_{i}}^{2}$ edges.
Therefore, the total number of edges $S$ satisfies
$$
\sum_{i=1}^{10} \mathrm{C}_{d_{i}}^{2}=S \leqslant \mathrm{C}_{10}^{2}-\frac{1}{2} \sum_{i=1}^{10} d_{i} \text {, }
$$

which implies $\mathrm{C}_{10}^{2} \geqslant \sum_{i=1}^{10} \mathrm{C}_{d_{i}}^{2}+\frac{1}{2} \sum_{i=1}^{10} d_{i}=\frac{1}{2} \sum_{i=1}^{10} d_{i}^{2}$.
Also, $\frac{1}{2} \sum_{i=1}^{10} d_{i}^{2} \geqslant \frac{1}{2} \times \frac{1}{10}\left(\sum_{i=1}^{10} d_{i}\right)^{2}$, so
$$
\mathrm{C}_{10}^{2} \geqslant \frac{1}{2} \times \frac{1}{10}\left(\sum_{i=1}^{10} d_{i}\right)^{2} \Rightarrow \frac{1}{2} \sum_{i=1}^{10} d_{i} \leqslant 15 \text {. }
$$

A specific construction is shown in Figure 1.