Pillows should be washed at least twice a year (the covers once a month, along with your mattress cover). Check the care label to confirm that your pillow (down or synthetic) can be machine washed - most can be. Use only ¼ cup HE liquid detergent rather than a powder to avoid residue. HE liquid cleans well but does not produce too many suds which are hard to rinse out. Adding a small measure of fabric softener or white vinegar to the rinse cycle will help to remove the detergent. Wash a 2 or 4 pillows together to keep the machine balanced and run them through the rinse cycle twice to rinse them fully.
For down and feathers, use the low heat or the air cycle and dry very fully. Make sure they are completely dry as dampness left in the pillow can lead to mold. Give them a good shake part way through drying and at the end of the dry cycle. For synthetics, use the low heat setting as high heat can cause clumping. Throwing in a couple of tennis balls wrapped in white socks during the dryer cycle helps to refluff the pillows without transferring dyes.