Let $K$ be a field, whereby $P(X) \in K[X]$ and $\alpha, \beta \in K$ with $\alpha \neq \beta$. Find the rest of the euclidean division of $P(x)$ through $(X-\alpha)(X-\beta)$ in terms of $\alpha, \beta, P(\alpha), P(\beta)$.
Ideas: Looking at the polynomial $P(X):=\sum^{\infty}_{0}a_{n}X^{n}$ and the divisor $X^{2}-(\alpha+\beta)X+\alpha\beta$. We realize that $P(X)=(X^{2}+(\alpha-\beta)X+\alpha\beta)q(X)+r(X)$ and we are required to find $r(X)$. We know that $deg(X^{2}+(\alpha-\beta)X+\alpha\beta)\geq deg(r(X))$ which means that $deg(r(X))\in {0,1}$. So in terms of actually doing the polynomial division are we only interested in $a_{2}X^{2}+...+a_{0}$ from $P(X)$.
Help is greatly appreciated.
Rule of thumb: Often when you have a polynomial already written as linear factors, multiplying them out might give you less to work with. You are losing information. I suggest we start with $$ P(X) = (X-\alpha)(X-\beta)\cdot q(X) + r(X) $$ similar to what you suggested, but now we can easily observe that $r(\alpha)=P(\alpha)$ and $r(\beta)=P(\beta)$ by simply substituting for $X$.
You have also correctly observed that $r$ has degree at most $2$, but this statement is actually far too weak - arguably the true power of Euclidean division is that the degree of $r$ must actually be less than the degree of what you divide by. Hence, The polynomial $r$ in this case has degree at most one.
Since $\alpha\ne\beta$ we are in luck, we can reconstruct $r$ by polynomial interpolation. Concretely, write $$ r(X) = \frac{X-\alpha}{\beta-\alpha} P(\beta) + \frac{X-\beta}{\alpha-\beta} P(\alpha) $$ and observe that $r(\alpha)=P(\alpha)$ as well as $r(\beta)=P(\beta)$.