Always wondered since pigs can't burp how do you reduce the chances of that problem?
A diet that is high in fibre (unlimited access to hay) and moderate on veg will help. Any gassy veg like cabbage, broccoli and cauliflower leaves should only be introduced slowly and fed as part of a mix, so the guts can adapt to process them and you won't have normally any issues. Unfortunately, cabbages are also the best source of magnesium, which is important for long term health, which is why recommend to feed a 1 inch strip of spring greens daily.
Ill and older guinea pigs can develop issues with their digestive system. Always take off fresh veg, especially brassicas, if there are problems and introduce them only very slowly again at least 24-48 hours after things have stabilised again.
Despite all your precautions, severe bloat can hit right out of the blue. Treat it as an absolute emergency if you find a piggy bloating up, especially if the belly is tight in places or overall and see a vet at any time of the day; he needs to decide whether you are dealing with bloat or a blockage (needs different treatment).
Have a vibrating device like an electric toothbrush or a vibrating car seat cover etc. at home to help shift the gas in addition to the meds you get from your vet.