Docusate is a common stool softener. Stool softeners are used on a short-term basis to relieve constipation by people who should avoid straining during bowel movements because of heart conditions, hemorrhoids, and other problems. They work by softening stools to make them easier to pass.
Stool softeners come as a capsule, tablet, liquid, and syrup to take by mouth. A stool softener usually is taken at bedtime. Follow the directions on the package or your prescription label carefully, and ask your doctor or pharmacist to explain any part you do not understand. Take stool softeners exactly as directed. Do not take more or less of it or take it more often than prescribed by your doctor.
Summary from MedlinePlus.gov, click for more information.