I was diagnosed with IBS about 15 years ago following a nasty intestinal bug, and I mean really nasty. It took about a months of heavy anti biotics.
There are some trigger foods but have learnt how anxiety plays a part. Definitely not fun living with it but I seem to cope a lot better these days. If I worry about my stomach it makes it that much worse.
I was once on anti depressants, then anti spasm meds... Stopped all that, eat better, take 1 probiotic a day and exercise. Everyone's gut is different though,what works for one doesn't for another.
I hope you get an all clear from the GI, then you can move forward from this.