not tmi pic idk where to post this

last night i had a bad headache and at the bottom of my stomach it was very painful. I then later woke up to go to the bathroom and i had diarrhea thinking i was sick i went back to sleep. Then today i went to the the bathroom again and i noticed a red thin string coming out of my butt. I don’t know what it is can someone help me?