For ballpoint pen and felt-tip marks on fabric, act quickly. Press a cotton-wool pad underneath the fabric, then dab the mark with a cotton-wool bud dipped in methylated spirits, before washing it. As a last resort use chlorine bleach, if the fabric is bleachable.
It's worth contacting the manufacturer for advice about pen stains. For delicate fabrics or heavy staining, professional cleaning is advisable.
From liquid ink
If the ink is still wet, pour salt on the stain and brush it off after a few minutes; repeat if necessary.
Sponge fabric or rub it under cold water until most of the ink has been flushed through. Wash as usual.
On carpets, squirt with soda water then blot with paper towels. Sponge with a detergent solution and blot.