Example 10 Let $\left\{a_{n}\right\}$ be an arithmetic sequence with a common difference of $d$, find the sum of the first $n$ terms of the sequence $\left\{a_{n} q^{n-1}\right\}(q \neq 0,1)$.

 untranslated text remains unchanged.
Let $S_{n}=\sum_{i=1}^{n} a_{i} q^{i-1}$, then $q S_{n}=\sum_{i=1}^{n} a_{i} q^{\prime}=\sum_{i=2}^{n+1} a_{i-1} q^{i-1}$, subtracting the two equations gives:
$$
(1-q) S_{n}=a_{1}+\sum_{i=2}^{n}\left(a_{i}-a_{i-1}\right) q^{i-1}-a_{n} q_{n} \text {, and } a_{i}-a_{i-1}=d
$$

Thus, using the formula for the sum of a geometric series, we obtain
$$
S_{n}=a_{1}(1-q)^{-1}+\left(d q-a_{n-1} q^{n}\right)(1-q)^{-2}
$$

This inspires us to consider a more general case: If the sequence $\left\{a_{n}\right\}$ is an arithmetic sequence and $\left\{b_{n}\right\}$ is a geometric sequence with a common ratio not equal to 1, then when finding the sum $a_{1} b_{1}+a_{2} b_{2}+\cdots+a_{n} b_{n}$, the method of misalignment subtraction can be used, similar to Example 4. Readers are encouraged to try this method.