It could be Sentinel pile,skin tag at the tip of the anus due to fissure in ano
It occurs when you pass hard stool.
You should take high fiber diet and take plenty of fluids.
If the swelling does not subside,consult a surgeon and get it removed.
Nothing to worry.
IT will be a small procedure.
Wish you good health