You don't get them from eating too much of something, at least, not specifically.
You get them from faulty organs and urine. Usually excess Y* would be removed from your system via piss. If it's not removed it crystallises, if it keeps happening, the crystals all join together and become stones.
Diet does play some part, but mostly it's got to do with what's going on inside you, so there is no general diet to follow, you have to know how your own body is processing whatever you are putting into it.
*Y being whatever the stones are made of.