How to use Kaopectate (docusate calcium) oral. This medication is used to treat occasional constipation. Some medications and conditions can make constipation more likely. Stool softeners such as docusate are often the first method used for preventing and treating this type of constipation. Docusate is often used when straining to have a bowel movement should be avoided (e.g., after a heart attack or surgery). Docusate is a stool softener.