The standard advice is to always take metformin with food, and to give your body time to get used to it in the hope that the side effects will ease.
For some people though, myself included, the side effects are persistent and just not worth whatever small benefits metformin may give.
I got my life back by binning the metformin and cutting enough carbs out of my diet to control my sugar levels, no drugs, no side effects.