You are probably suffering from fissure in ano, and it is definitely not the first time you are having this problem. It is basically associated with constipation and passage of hard stools.
Next Steps
and if there is a bleeding and opening is very tight then it will be difficult to cure it with just medications.
it should be examined first to make the final diagnosis and to suggest you the further management.
Health Tips
Till the time you do warm water sitz bath, take a laxative to loosen your stools and take a painkiller.