How do you stop having gas?

To stop having gas, you have to go to the bathroom regularly -_-