Let $M$ be a new parameter (constant) that equals a large number.
Greater-than-or-equal-to constraints:
The constraint is $a_1x_1 + \cdots + a_nx_n \ge b$. Rewrite it as
$$a_1x_1 + \cdots + a_nx_n \ge b - M(1-y).$$
Then, if $y = 1$, the constraint is active, and if $y=0$, it has no effect since the right-hand side is very negative.
(If all of the $a_i$ are nonnegative, you can instead use
$$a_1x_1 + \cdots + a_nx_n \ge b(1-y),$$
which is tighter.)
Less-than-or-equal-to constraints:
The constraint is $a_1x_1 + \cdots + a_nx_n \le b$. Rewrite it as
$$a_1x_1 + \cdots + a_nx_n \le b + M(1-y).$$
Then, if $y=1$, the constraint is active, and if $y=0$, it has no effect since the RHS is very large.
Equality constraints:
The constraint is $a_1x_1 + \cdots + a_nx_n = b$.. Rewrite it as
$$\begin{align*}
a_1x_1 + \cdots + a_nx_n & \le b + M(1-y) \\
a_1x_1 + \cdots + a_nx_n & \ge b - M(1-y)
\end{align*}$$
Then, if $y=1$, the equality constraint is active, and if $y=0$, the constraints have no effect.
Note: If your model is relatively large, i.e., it takes a non-negligible amount of time to solve, then you need to be careful with big-$M$-type formulations. In particular, you want $M$ to be as small as possible while still enforcing the logic of the constraints above.
Related: In an integer program, how I can force a binary variable to equal 1 if some condition holds?