It's better for you to consult with general surgeon in your area,to clinically examine to find out exact cause of Anal pain as it has many causes.
Next Steps
meanwhile till you arrange for a appointment with surgeon ,you can use stool softener to avoid constipation ,sit in sitz bath for 15 minutes twice daily,and use high fibre diet,
drink lots of water