Welcome to Healthcare Magic
You could be having this problem more than few months which means chronic fissure. In such cases only surgery will cure. You have to eat plenty of fresh fruits and green leafy vegetables. Drink plenty of water. You can have stool softener
as well because if stool is soft then very less pain but hard stools means less healing of the fissure and lot of pain. For relief you can sit in warm water in shallow tub 2-3 times a day called Sitz bath. Also application of Xylocaine
gel will work for reducing pain. But only cure is surgery to widen the opening to prevent tightness of the anal sphincter. Nothing to worry. It is relatively safe and you will be more comfortable after the surgery.