The method needed to solve this problem is the Lagrange multiplier method with multiple constraints. In general, if you wish to minimise or maximise $f(\mathbf{x})$, subject to any number of constraints $g_1(\mathbf{x}) = 0$, $g_2(\mathbf{x}) = 0$, $g_3(\mathbf{x}) = 0$ etc., then define the "Lagrangian" as the function
$$\mathcal{L}(\mathbf{x},\lambda_1,\lambda_2,\lambda_3, \dots) = f(\mathbf{x}) + \lambda_1 g_1(\mathbf{x}) + \lambda_2 g_2(\mathbf{x}) + \dots $$
The problem is solved by doing an unconstrained optimisation of $\mathcal{L}$. That is $\partial \mathcal{L}/\partial x_i = 0$ for all $i$ and $\partial \mathcal{L}/\partial \lambda_i = 0$. Note that the second equation just recovers the constraint $g_i(\mathbf{x}) = 0$.
In your case, the Lagrangian would be
$$\mathcal{L}(\mathbf{y}, \lambda_1,\lambda_2) = \sum_{i = 1}^n (x_i - y_i)^2 + \lambda_1 \sum_{i = 1}^n y_i + \lambda_2 \sum_{i = 1}^n \beta_i y_i$$
The solution is then found by
$$\partial \mathcal{L}/\partial y_j = 0 = -2(x_j - y_j) + \lambda_1 + \lambda_2 \beta_j$$
Your constraints can then be used to eliminate the lambdas.