"is it about food/actions on the race day morning or food the day before or even overall diet?"
A bit of all of the above, really. Plus getting into a set routine that works, then sticking to it.
People with spinal cord injuries are often taught in rehab how to re-train their bowel so that they can reliably 'empty out' at whatever time of day suits them best. I'm fairly sure the general advice they are given would work just as well for able bodied people. Again, I think it's mostly about routine.
For me, an early rise and a mug of coffee does the trick.