This is commonly due to piles or a small skin tag near the anus, especially if pain happens only with hard stool. Controlling constipation with more fluids, fiber, and avoiding straining usually helps.
Next Steps
If symptoms persist or increase, proper examination is needed. Please consult me for detailed evaluation and treatment guidance.