The problem you are describing seems to be a case of anal fissure, although physical examination is always welcomed to conclude any diagnosis.
Are you having hard stool or do you have to strain while defecating??
Next Steps
Do Sitz bath with lukewarm water 3-4times daily and apply Anobliss ointment after every Sitz bath & before defecation.
Drink plenty of fluids, avoid heavy meat in diet
Take stool softener daily
Health Tips
It will be better if you visit any general surgeon or proctologist for better evaluation and management.