Because this question has been posted in the Women's Health Community, are you talking about menstrual cramps?
For menstrual cramps
you need to have a good healthy diet with
lots of fresh fruit and vegetables and fish. Plenty of fluids, especially water. 2 litres a day is usually recommended, more if you sweat a lot. Make sure that you are well hydrated.
Cut out junk foods, sugary foods, like sweets, cakes, biscuits, chocolates, sweets and fizzy drinks. Avoid using processed foods.