We want to write $\dfrac1{(y-a)(y-b)} = \dfrac{A}{y-a} + \dfrac{B}{y-b}$ The right hand side can be simplified as $\dfrac{A}{y-a} + \dfrac{B}{y-b} = \dfrac{A(y-b) + B(y-a)}{(y-a)(y-b)} \,\,\,\,\,\,\,\,\,\,\,\, (\star)$ We want $(\star)$ to equal $\dfrac1{(y-a)(y-b)}$. For this to happen, we need $A(y-b) + B(y-a) = 1 \,\,\,\,\,\,\,\, \forall y\,\,\,\,\,\,\,\,\,\,\,\, (\dagger)$ Now there are couple of ways to go about solving this. A simple way is as follows. Since $(\dagger)$ is true for all $y$, the equality holds for $y=a$ and $y=b$ as well.
Setting $y=a$, we get that $A(a-b) = 1 \implies A =\dfrac1{a-b}$.
Setting $y=b$, we get that $B(b-a) = 1 \implies B =\dfrac1{b-a}$.
A slightly more general way (which is very much related to the above procedure is as follows).
Note that $(\dagger)$ can be written as $(A+B)y - (bA+aB) = 1 \,\,\,\,\,\,\,\, \forall y$ Since this is true for all $y$, the coefficient of $y$ should be $0$ and $-(bA+aB) = 1$. Hence, we get that \begin{align} A+B & = 0\\ -(bA+aB) & = 1 \end{align} Solving the above equations, give us $A = \dfrac1{a-b}, \,\,\,\,\,\,\,\,\,\, B = \dfrac1{b-a}$