Mayo Clinic has a useful overview explaining that intestinal gas can be influenced by both food choices and everyday eating habits. Their tips on how to prevent loud farting include eating and drinking more slowly and cutting back on carbonated beverages.
I would first pay attention to whether beans, lentils, certain vegetables, dairy products, or sugar substitutes seem to cause more gas for me. Rather than removing everything at once, I’d probably test one possible trigger at a time. Eating more slowly could also help because rushing through meals may cause me to swallow more air.
I’d also try taking a short walk after eating, since Mayo Clinic mentions movement as one simple measure that may help with digestive gas. Keeping notes about what I eat and when the problem occurs could make the pattern much easier to recognize. If the gas became persistent or appeared together with significant pain, bowel changes, or unexplained weight loss, I’d speak with a healthcare professional.