If it's been a while since you got the carpet in your home installed, you may start to notice dark lines appearing around the edges that abut the walls, especially if your carpet is white. Either soot is piling up because you can't reach these areas with your vacuum cleaner, or it is accumulating there due to discharge from the heating and cooling vents, or duct work. There is a way to clean these edges, and it is fairly simple.
Use the crevice tool on your vacuum cleaner to remove all the surface dirt that you can from the edges of your carpet. If your vacuum doesn't have a crevice tool, you can accomplish the same task by wrapping your hand with package tape, sticky side out, and touching the tape to the carpet's fibers. Note that this method takes considerably longer, since you'll have to keep replacing the tape as it gets soiled.
Spray water-based carpet cleaner along the edges of your carpet, being careful not to get it on your walls. Look at the directions on the package to determine how much to use. Let the cleaner set for 5 minutes.
Scrub the areas you sprayed with a soft bristled toothbrush. Use gentle pressure so you remove the soil, but don't damage the carpet fibers. It's best to work in the direction of the fibers, instead of in circles.
Dab at the carpet with an old towel to remove the dirt the cleaner has brought to the surface. Then wet a second towel in the sink, wring it out and use it to rinse the cleaner out of the carpet by gently scrubbing. Pat the water out of the carpet with a third towel. Let it air dry.
Check the carpet to make sure all of the dirt is gone. If not, repeat Steps 2 through 4. If you've followed each step three times and there is little improvement, you may need to hire a professional carpet cleaning company.