Please be advised this does not constitute health advise or a legitamate diagnoisis, you will need to contact a medical professional for an accurate medical diagnosis. Please seek medical advise if concerned.
With no further information from the question, I would guess this is from being so constipated that the individual had to strain to achieve bowel movements, which caused a small tear just inside the rectum and the individual may had a small internal hemorrhoid that is aggrevated (hemeroids are distended blood vessels usually from chronic constipation or child birth). Diet modification is an easy solution (start eating foods rich in fiber, such as a bran cereal.
If the blood in the stool is from diarrhea, it could be any number of things (a visit to your doctor can adequately diagnose this). Diarrhea with blood in stool form someone with chronic constipation is more of a sign of the bleeding hemeroid issue.
viral Gastroenteritis - inflammation of the stomach and intestines caused by a virus
Food poisoning (if in the last 24 hours) - urgent care may be required
Colitis - inflammation of the colon
Amebiasis - parasitic infection of the intestines