It can be a case of anal fissure, that occurs if you have hard stool and have to strain during passing stool. Clinical examination is always appreciated for better assessment.
You have to do Sitz bath with lukewarm water (sit in tub with lukewarm water in it) 3-4times daily
Apply Anobliss/Escot ointment after every Sitz bath
Use stool softener
If pain is unbearable, then pain killer is to be taken.
Next Steps
Consult a Proctologist or General Surgeon for better examination
Health Tips
Have plenty of oral fluids and high fibre diet