Step 1: First and second derivatives.
\[ y = e^{px} \sin qx \quad \Rightarrow \quad y' = e^{px} \big(p \sin qx + q \cos qx \big) \]
Differentiate again:
\[ \begin{aligned} y'' &= \frac{d}{dx} \Big[e^{px} (p \sin qx + q \cos qx)\Big] \\ &= e^{px} \Big[ p(p \sin qx + q \cos qx) + (pq \cos qx - q^2 \sin qx) \Big] \\ &= e^{px} \Big[ (p^2 - q^2) \sin qx + 2pq \cos qx \Big]. \end{aligned} \]
Step 2: Form the required combination.
\[\begin{aligned} y'' - 2py' + (p^2 + q^2) y &= e^{px} \Big[(p^2 - q^2) \sin qx + 2pq \cos qx \Big] \\ &\quad - 2p \, e^{px} (p \sin qx + q \cos qx) \\ &\quad + (p^2 + q^2) e^{px} \sin qx \\ &= e^{px} \Big[ \underbrace{(p^2 - q^2 - 2p^2 + p^2 + q^2)}_{=0} \sin qx + \underbrace{(2pq - 2pq)}_{=0} \cos qx \Big] \\ &= 0 \end{aligned} \]
\[\boxed{0} \]