My 2 year old has had a bm in 4 days and is cry complaining of hard say she need to have a bm. What can I give her for fast relief? She's in pain

Emergency relief. Use a glycerine suppository or give an enema until clear.
CONSTIPATION. Miralax (polyethylene glycol) 1-2 teaspoon twice daily in gatorade, any juice, milk or water, for few days until gets loose stools. Then 1 teaspoon x 1-2/d to have soft stool. Make sure she drinks enough fluid, more fiber in diet, e.g. Oatmeal, vegetables. Can give prune juice 2-3 ounces 1-2/day. If not better, see her pediatrician. Hard stool can tear anal orifice causing severe pain, the child become afraid of poopin.