We have
$$|f(x_1, y_1) - f(x_2, y_2)|=|f(x_1, y_1) -f(x_1,y_2)+f(x_1,y_2)-f(x_2, y_2)|$$
$$\leq
|f(x_1, y_1) -f(x_1,y_2)|+|f(x_1,y_2)-f(x_2, y_2)|.$$
Apply the mean value theorem to the function $f(x_1,y)$ (i.e. fixed $x_1$ and consider it as function of $y$), we have
$$f(x_1, y_1) -f(x_1,y_2)=f_y(x_1,\xi)\cdot(y_1-y_2)$$
where $\xi$ lies between $y_1$ and $y_2$, which implies that
$$|f(x_1, y_1) -f(x_1,y_2)|\leq |f_y(x_1,\xi)|\cdot|y_1-y_2|\leq K\cdot|y_1-y_2|.$$
Similarly, if we apply the mean value theorem to the function $f(x,y_2)$, for some $\eta$ lies between $x_1$ and $x_2$ we have
$$|f(x_1, y_2) -f(x_2,y_2)|=|f_x(\eta,y_2)|\cdot|x_1-x_2|\leq K\cdot|x_1-x_2|.$$
Combining all these, we obtain
$$|f(x_1, y_1) - f(x_2, y_2)|\leq
|f(x_1, y_1) -f(x_1,y_2)|+|f(x_1,y_2)-f(x_2, y_2)|$$
$$\leq K\cdot|y_1-y_2|+ K\cdot|x_1-x_2|\leq \sqrt 2 K \sqrt{(x_1 - x_2)^2 + (y_1 - y_2)^2},$$
where the last inequality follows from $A+B\leq\sqrt{2}\sqrt{A^2+B^2}$.