The below texts are from the book Introduction to Analytic Number Theory by Apostol:
Trying to calculate $\sum_{n\le x} \sigma_{\alpha} (n)$ for negative $\alpha$ I followed the advice of the book, i.e. " ... we write $\alpha = - \beta$, where $\beta>0$" and the recipe in Theorem 3.5. above. So, $$\sum_{n\le x} \sigma_{-\beta} (n) = \sum_{n\le x} \sum_{q|n} \dfrac{1}{q^{\beta}} = \sum_{d\le x} \sum_{q\le x/d} \dfrac{1}{q^{\beta}} = \sum_{d\le x} \left\{\frac{1}{1-\beta} (\frac{x}{d})^{1-\beta} + \zeta (\beta) + O (x^{-\beta})\right\} = \dfrac{x^{1-\beta}}{1-\beta} \sum_{d\le x} \dfrac{1}{d^{1-\beta}} +\dfrac{x}{2} \zeta(\beta)+ O(1) + O\Big(\dfrac{x^{1-\beta}}{1-\beta}+\zeta(\beta)+x^{-\beta}\Big). $$
I am disappointed to go further for two reasons: a. $\sum_{d\le x} \dfrac{1}{d^{1-\beta}}$ has not a single formula for any $\beta>0$ and b. the book has solved it differently and I don't know the equivalence of the different methods, i.e.
How $\sum_{d\le x} \sum_{q\le x/d} \dfrac{1}{q^{\beta}} = \sum_{d\le x} \dfrac{1}{d^{\beta}} \sum_{q\le x/d} 1$? (especially they probably are not equal as they result in different answers.)


I think that the step you are having trouble with is this one? $$\sum_{n \leq x} \sum_{d|n} \frac{1}{d^\beta}= \sum_{d \leq x} \frac{1}{d^\beta} \sum_{q \leq x/d} 1$$
Perhaps this makes it more clear? $$\sum_{n \leq x} \sum_{d|n} \frac{1}{d^\beta} = \sum_{qd \leq x} \frac{1}{d^\beta} = \sum_{d \leq x} \sum_{q \leq x/d} \frac{1}{d^\beta} = \sum_{d \leq x} \frac{1}{d^\beta} \sum_{q \leq x/d} 1$$
Here you should regard the sum $\sum_{qd \leq x}$ to mean the sum over all pairs of positive integers $(q,d)$ such that $qd \leq x$.