Example 2 Find the sum $S=\sum_{k=1}^{n} k^{2}$.


Let $a_{k}=1, b_{k}=k^{2} (k=1,2, \cdots, n)$,
then $S_{k}=\sum_{i=1}^{k} a_{i}=k, b_{k}-b_{k-1}=k^{2}-(k+1)^{2}=-(2 k+1)$, by Abel's summation formula, we get
$$
\begin{aligned}
S & =\sum_{k=1}^{n} k^{2}=\sum_{k=1}^{n} a_{k} b_{k}=S_{n} b_{n}+\sum_{k=1}^{n-1} S_{k}\left(b_{k}-b_{k-1}\right) \\
& =n \cdot n^{2}-\sum_{k=1}^{n-1} k(2 k+1)=n^{3}-2 \sum_{k=1}^{n-1} k^{2}-\sum_{k=1}^{n-1} k \\
& =n^{3}-2 S+2 n^{2}-\frac{(n-1) n}{2}
\end{aligned}
$$

Rearranging terms, we get
$$
S=\frac{1}{3}\left[n^{3}+2 n^{2}-\frac{(n-1) n}{2}\right]=\frac{n(n+1)(2 n+1)}{6}
$$