Painful bm

My 8m old has just started screaming in agony over bowel movements the past few days. What can i do to help? Is there an over the counter?