Passing gas in public can be embarrassing but everyone does it and there's no need to worry about it.
But you can try taking some gas reducing supplements or Beano to reduce gas build up in your stomach so that you're not having to fart as much while in public.
When you have to fart though don't hold it back as your body needs to get rid of that gas and holding in the gas can cause stomach pain and bloating.