I'm sorry to hear that you are having such discomfort! I strongly recommend that you give your primary care doctor
a call, as they will be able to help you with this issue.
It sounds like the most likely cause of your pain is simply irritation of the skin surrounding the anus, which is a common problem in the setting of bad diarrhea
. Usually this irritation can be soothed with topical barrier creams or moisturizers, and your doctor can give you some good recommendations.
Additionally, occasionally there may be a more serious problem that occurs in the setting of severe diarrhea, such as a crack or fissure at the edge of the anus. This may lead to infection, and it may require more aggressive treatment with local skin care or even with antibiotics.
Your doctor will also be able to weigh in on the cause of the diarrhea. If the diarrhea has resolved and is not a recurrent problem for you, then it is probably just from a passing intestinal infection. However, there are underlying medical conditions which can cause severe diarrhea, such as inflammatory bowel disease
, and some of these may be associated with significant inflammation of the tissue around the rectum and anus, which is worth ruling out.