It seems that you're having fissure
so you need to be examined by a general surgeon
to be done to find out what exactly it is, keep your stool soft by taking plenty of fluids orally and high fibre diet
even you can take syp cremaffin
3 to 6 tsf hs daily, use ointment lox
anally before defecation and proper treatment follows according to examination.