How can I treat my 5 months baby from constipation? She just started solid foods.

Diet change/water. Constipation is common with the introduction of solids but typically resolves. In the meantime, increase water intake. Avoid constipating foods like bananas and rice and give foods which are higher in fiber. Fruits that start with the letter p can help you poop (pears, prunes, peaches, etc.).
Define & use natural. If your baby is having firm stools that are hard to pass, i accept the label.If breast fed, stooling less often& skipping days i would leave it alone if still soft.I've had success with undiluted prune or apple juice, 1oz once or twice daily.Water may also help . The aap doesn't advocate many foods before 6mo & i encourage moms to wait until they sit..Avoid apple sauce/bananas/cereal for sure if hard.