You are most likely constipated. Please increase water and fibre intake in your diet. For the pain you can sit in warm water bath for 10-15 minutes 2-3 times a day and also apply 2% lox jelly.
Next Steps
in case the pain and constipation does not settle in two days please visit a general surgeon as you will need an examination to rule out anal fissure
Health Tips
don't strain while passing stool. Watch for bleeding