What's her diet like now?
Generally, things like dried fruit are good for helping ease constipation - dates, prunes, apricots etc. Avoid banana. Some kids respond well to fruit juices - my youngest only has to look at a glass of apple juice and she needs a poo, whereas my oldest could drink it all day with no effect at all (and it was her with the constipation issues unfortunately).
Have a look at how much fibre she is getting and what kind. Sometimes kids need more fibre, sometimes too much can make the problem worse. Experiment with brown or white bread and the same with pasta and rice. You probably need a good mix rather than all brown or white.
Drinking enough is probably the biggest thing you can do. How much water does LO drink now? A wise doctor once told me that if your LO is drinking the 'right' amount for her age and she's still constipated it just isn't enough water for HER - everybody has different needs. So try and up the water intake as much as you can.
Reducing dairy can sometimes help too, so watch for milk, yoghurts, cheese etc. You could try watering down her milk if she does like it a lot, just a little at first and do it slowly to give her chance to adjust to the new taste. Do make sure she's getting everything she needs elsewhere though if you cut it out.
If she is really suffering with constipation, I'd urge you to go to the doctor and get her some laxatives once any medical issues are ruled out. Children are quick to learn that pooing hurts and sometimes they can stop pooing. Once you have a child who withholds, you're into much deeper water! So if it is just about diet, I would get something to help stop the pain NOW because diet takes a while to fix. You don't want LO in pain until you've worked it out.