As long as your foundation is structurally secure, you can dig right beside it without compromising its integrity -- until you reach the footing. Potential problems with the dig include trench collapse and the unintended disturbance of utility lines or pipes. Digging by the foundation is essential for some types of foundation repair or drainage issues, but there's more to the project than just dirt removal.
Before You Dig
Call your local building authority about taking out a permit for the project. Digging a small area usually doesn't require a permit, but major excavation, the installation of a footer drain or altering your foundation probably does. Place additional calls to your local utility companies who will check for buried lines and pipes.
If you're digging down just a foot or two in a small area, you can probably dig the old-fashioned way -- with a shovel. For bigger digs, call an experienced backhoe operator who can quickly excavate a trench right beside the foundation wall. Digging stops at the footer, which extends eight inches or so outward from the bottom of the foundation wall. The footer serves to disperse the weight load from your house into the ground beneath. Disturbing the soil here may result in shifting of the foundation.
Install trench supports to stabilize the soil wall. Trench supports include reinforcement with timbers, a trench cage designed to withstand collapse or the construction of a trench wall. Stair-step or sloped excavation is safer than vertical wall excavation. It requires the removal of more soil, but it creates a slope that reduces the risk of cave-in or rocks and soil rolling onto the workers.
Mother Nature doesn't always comply with outdoor construction projects. If rain is in the forecast, postpone the dig. If you must dig during a rainy spell, tarp the trench to keep it from filling up with water that you must pump out before work can continue. Once you complete the project, you must put the soil back in the trench. The proper way is to backfill in "lifts," which involve adding approximately 1 foot of soil in the trench and compacting it before adding another foot and compacting it.