The bloating could be caused by a few different factors.
If you don’t chew your food enough (30+ times per bite) then you are not breaking down the food you eat enough. When this happens, the food could ferment in the gut causing gas because your body is having trouble digesting it. Digestive enzymes or bitters can help break down the food you eat.
You could have a deficiency in stomach acid like the others stated and this also prevents your body from breaking down the food it eats, and this can benefit other bad bugs in the gut like parasites, bacteria, microbes, etc.
Your digestion is very much tied to your liver health, so if you haven’t healed your liver properly then this can mess up the whole cycle essentially.
If you are constipated and poop less than 3 times per day, then your sluggish digestion can cause all of this. To remedy constipation it takes a long time but chewing your food, antifungals, prebiotics, and probiotics all aid digestion. There are other products that aid it as well.