I'm an expert on this so happy to share what I've learnt the hard way (sorry).
Prebiotics - take inulin every day. Add it to slow cooked stews and drinks. It's tasteless.
www.medicalnewstoday.com/articles/318593.php
Add linseeds in cooking, ie stews, porridge etc.
Porridge oats made with water or live kefir fermented yoghurt, not milk. Add prunes.
Magnesium Citrate, 800mg per day.
Probiotics every day.
Live yoghurt every day.
Try sauerkraut.
Drink lots of water and eat plenty of fruit and veg.
Get lots of exercise, especially walking or running.
The biggest helper is Inulin. Also available in pre-measured sachets called ??? (I'll come back with the name) Add it to whatever you can or just drink it down in a glass of water.
Read Dr Michael Moseley's book, I think it's called the Good Gut Guide.