From your history as there is red line in stool indicates that you might be having fissure-in-ano.
Consult surgeon and get examined.
Confirm the diagnosis and rule out false fear of having cancer.
Take mild laxative at night.
Take plenty of water and more fiber containing diet.
ok and take care.