you can take diet which doesn't cause constipation
rather you should increase fibre content & water in your diet which will soften your stool.
Ishapgul also facilitates stool evacuation.
you can take antiinflammatory medicine if inflammation is also there.
A course of metronidazole
may also help you.
anaesthetic gel can be applied over anus before & after passing of stool.
avoid outside food