Use probiotics, specifically Lactobacillus reuteri (L. reuteri), and expect improvement after 7 days.
In the past decades, there was a steady growth of evidence that probiotics have many benefits and few side effects for both adults and babies.
There are several studies on specific strains (see below), but there is no consensus as to the best strains. So my layman's choice was to select an inexpensive powdered mix of multiple bacterial strains, covering a few of Lactobacillus (such as L. reuteri) and Bifidobacterium strains.
We used Udo's choice infant probiotic (a mix of multiple bacterial strains, as powder), daily for the first year or so, starting with birth, as a prophylactic for colics and diarrhea. As with all bacterial probiotics, I bought them only in the refrigerated section of the stores (Whole Foods, or specialty health food stores), and stored them in the fridge.
Not sure if this had any effect, or we were just lucky, but the kids did not experience any colics, and when they did have diarrhea, it was short-term.
Clinical Guide to Probiotic Products Available in USA: http://usprobioticguide.com/
Using probiotics in the paediatric population | Position statements and practice points | Canadian Paediatric Society:
If you need more, search Google using the terms:
pubmed probiotics infants gas, or something similar. You can find plenty of research results on the topic, most of which support the recommendation of probiotics for gas pain or colics, for example:
Koonce, T., Mounsey, A., & Rowland, K. (2011). Colicky baby? Here's a surprising remedy. The Journal of family practice, 60(1), 34–36: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3183958/
This articles cited the dose of L. reuteri, 100 million colony-forming units (abbreviated CFU) daily, with improvements above placebo seen after only 7 days.