Thank you for the query.
What are you suffering from is anal fissure
. This is a kind of rectum
open wound which causes terrible pain. In most cases it is caused by constipations so getting rid of constipation is a very important to get it healed. No surgery necessary for anal fissure (surgery can be done if such fissure is not healing and lasts for months).
To get it treated you should take care of your stools. Your stools should be soft and you should prevent constipations. To do that you should drink more water, eat some soups instead of solid meals, increase fiber rich foods. Very important is to not push hard when passing stool as it causes rectal "skin" tearing.
Hot baths with Quercus Cortex
and washing rectal area after every stool can help as well.
You can ask your doctor about ointment with Nitroglicerine (it relaxes rectal muscle)
Cream with Xylocaine
will ease the pain.
Hope this will help.