It is an individual thing.
For me, I know that I cannot eat red meat, ever again, no matter what.
Then, I have a list of trigger foods.
When I'm in a flare, I cannot eat any of my trigger foods (corn, broccoli, high fat foods, high fiber foods, fried things, grapes, cabbage, salad, cucumbers, radishes, etc). I have to stick to bland things like bananas, apple sauce, rice, boiled chicken, toast, soup, etc. When my system is calm again and you will learn when yours is, I can slowly add some of those trigger foods back, but I have to pretty much always eat very small portions of these and not often. Again, you will learn this as well.
You will have moments when you will pig out and you will think, why did I do that, especially after a long episode of pain. It's all a part of the learning process. It's a psychological loss. It's a process. It's difficult when you learn that a lot of the foods you so love, actually are the ones that are hurting you most. Again, it's a process and it's only human nature to throw a temper tantrum and eat the foods you yearn for because you are "sure that you will find a way to not be triggered by them".
I also find that I am much more likely to have issues when I eat out at restaurants for some reason. I do have my favorite restaurants which I know the foods I eat there sit well in my gut and then the rest of the time, I cook at home. I don't feel limited. I used to, but now it seems like a normal way of life for me.
After several years, this will pass. I still get moments where I wine and think it's so unfair that I cannot eat a filet mignon like normal people. OMG those were so good with a-1 and some horse radish or some worstershire sauce or nice big juicy hamburger! And cabbage. I love large quantities of cabbage, cucumbers, pickles, and popcorn with tajin and . . .I love salad! I'm a rabbit! . . . well, the point is, my body does not like them. Forgive me for my spelling. But anyway . . . the craving passes just as quickly as it came and then I'm done with my pity party.
Someone else mentioned keeping a food journal. It's very good advice. I would not advise keeping one while you are in a flare though because it's hard to see through it and it will seem like you can't eat anything and the data will be really inaccurate. When you are out of flare, keep the diary. You will find a pattern in no time. It helps to look online for a list of foods that commonly trigger IBDs to have a guide to help you find patterns more easily. Just my opinions though.
Best wishes to you!