Hello Mohammad Hanif , hi
Warm welcome to Healthcaremagic.com
I have evaluated your query thoroughly .
*  Possible  causes  are  
    -  
hemorrhoid  -  fissure  -  infection  -  inflammation  -  others .
*  It may happen  from
    -  hard  stools  -  
constipation  -  bacterial  infection  -  anal  intercourse 
*  Suggestions for better  recovery  
    -  Tab. 
ibuprofen ( 400 ) mg 3 times a day after meals  with  antacids .
    -  Bulk  forming  laxative  as  ispaghula  husk  3 teaspoonful  at  night
        with  a  glass of  drinking  lukewarm  water .
    -  Sitz  bath  (  sitting  in tub filled  with lukewarm  water  5  minutes           
                  each  2  times  a  day and additionally after passing stools )
    -  Local  application  of  
Xylocaine ( 5 % ) jelly .
*  Dietary  suggestions  
    -  Drink plenty of liquids .
    -  High fiber diet with organic fresh fruits , whole grains , green  leafy 
        vegetables , cereals , pulses , legumes , fresh  curd .
    -  Avoid  all oily , spicy , non veg , hot beverages , junk foods .
*  Consult later your  doctor  for  final  diagnosis and further  management .
Hope this will help you for sure .
Wishing you fine recovery .
Regards .