If your comforter is made of cotton or a cotton and polyester blend that fits in your washer, you can most likely wash it at home. You should always check the laundering instructions on the tag before proceeding. Before you get it wet, you'll want to make sure it's colorfast, meaning that the colors won't run. To do this, wet an area that won't be very noticeable. Unless your comforter comes with specific instructions, you should wash it in warm to hot water and dry it on low heat so it won't shrink or scorch. Adding a clean tennis ball to the dryer will help keep filling from clumping together. You can also save on your electricity bill by hanging it outside to air dry. Do keep in mind that a wet comforter can get really heavy, so determine if your machines can handle the weight. If you're not sure, consider taking it to the laundromat and using one of their commercial machines.
Not all comforters are good candidates for the washing machine. King-sized comforters may be too large for your machine and some materials, like silk or velvet, shouldn't get wet. And if you have an heirloom quilt that is old and fragile, it definitely shouldn't get tossed around in your washer. So, you have two options: hand washing or dry cleaning.
To hand wash, start by spreading your comforter out and vacuuming off any dust and dirt with a brush attachment. Then, fill a large utility sink or your bathtub with warm, soapy water and submerge your comforter fully. Agitate it in the water, making sure that the entire surface is wet. You may have to scrub any stains or spots with a sponge. Drain the soapy water and fill with clean water to remove the soap. You may have to repeat this step once or twice until the soap is gone. And then hang your comforter on a clothing line to dry. If there are materials on your comforter that can't get wet, then you'll have to spot clean the areas that can.
However, if you're ever in doubt about the fabric, or you know the fabric is too delicate for a normal cleaning, then you should take your comforter to the dry cleaners and let the professionals handle the job.