Consider $x^{2}+3xy-5x+2y^{2}-7y+6$ as a polynomial over variable $x$.
$$x^{2}+\left(3y-5\right)x+2y^{2}-7y+6$$
Find one factor of the form $x^{k}+m$, where $x^{k}$ divides the monomial with the highest power $x^{2}$ and $m$ divides the constant factor $2y^{2}-7y+6$. One such factor is $x+y-2$. Factor the polynomial by dividing it by this factor.