Cholic acid is primarily used to treat peroxisomal disorders and bile acid synthesis disorders in infants, children, and adults.