Example 3 Draw a line $l$ through the point $(1,4)$, such that its intercepts on both coordinate axes are positive, and the sum of the intercepts is minimized. Find the equation of the line $l$.
Solution: Let the equation of the line be $\frac{x}{a}+\frac{y}{b}=1$, then since the point $(1,4)$ lies on $l$, we have $\frac{1}{a}+\frac{4}{b}=1$. Thus, $S=a+b=5+(a-1)+\frac{4}{a-1}$.

Also, since $a>0, b>0$, it follows that $a-1>0$. Therefore, $S \geqslant 5+2 \sqrt{(a-1) \cdot \frac{4}{a-1}}=9$, and when $a-1=\frac{4}{a-1}$, i.e., $a=3$, $S_{\min }=9$. At this point, the equation of the line $l$ is $2 x+y-6=0$.