Your first consideration when washing is what to do about the pillow cover. On regular bed pillows, you would remove the pillowcase and the protective cover, if there is one. Both can be washed in your home washing machine and dried in your dryer, with one exception. If you protective pillow covers are made of plastic or have a rubber-like lining, you can wash them in the machine but should hang them to dry rather than putting them in the dryer.
Throw pillow covers present more of a challenge. A cover with a zipper or other closure can be removed and washed in the machine or dry cleaned, depending on the fabric care instructions that you would find on an inside seam of the cover. If the pillow does not have a closure you can open, you may want to remove the cover by opening a seam in the cover so you can remove it. On the other hand, if the cover is made of a washable fabric, you can leave it on the pillow.
Wash small foam pillows in the washing machine on the delicate cycle, as you don't want a lot of agitator action to shred the pillow. Air dry foam pillows. Do not put them in the dryer because they would likely melt, creating a mess and a potential fire hazard. To kill dust mites and other insects, use hot water and a mild detergent.
Large foam pillows cannot be washed in a home washing machine because they could be damaged by the action of the agitator or prevent the agitator from moving properly in the machine. If the pillow is not huge, try washing it in a front-loading commercial washer at the Laundromat. Air dry the pillow.
Wash feather pillows (if they are no bigger than bed pillows) in the washing machine with cool water and a detergent made especially for delicate items. Use the gentle cycle. Feather pillows should be washed only in front-loading washers. The agitator in a top-loader will damage the pillow. The life of a feather pillow can be prolonged or ended, depending on how you dry it. Feather pillows should be dried in the drier on the low heat setting. Feather pillows must be fluffed as they dry; you cannot fluff them after they are dry because the feathers will have all matted.
To fluff feather pillows in the dryer, dry no more than two pillows in a home-sized dryer. Put two tennis balls in with the pillows. Dry feather pillows on low heat, stopping the dryer every 20 minutes to fluff the pillows by hand.
Pillows filled with cotton batting can be washed in the washing machine on the gentle cycle. Use a mild detergent such as those formulated to delicates. Use a front-loading washer. Wash only two pillows at a time in a home washer. Dry in a dryer on medium to high heat.