Some digging tips:
Digging works in a slightly unexpected way. Dirt is removed and added not from and to whole tiles, but corners of tiles. Elevation and tile slopes are all a matter of corner heights. Keeping this in mind can make leveling or sculpting an area much easier. The game keeps track of elevations in units of dirt: when you dig you remove 1 dirt unit from the nearest tile corner and thus lower its elevation by 1 unit.
Another interesting thing about digging and dirt is that if you drop dirt on a corner with a slope coming from it that is something like 40 dirts steep away or more, instead of raising the corner the dirt will "flow" downhill until it reaches a corner where there are no slopes too steep away. This means you can't create slopes more than 40 dirts steep by dropping dirt, but you can make them steeper by digging out the lower corners.
The maximum elevation difference you can dig down to is your digging skill times three.
The easiest way to level ground is to Examine the tile borders between tiles. This tells you what the slope is in dirts, which is the difference in dirt levels between the two corners on the ends of that border. Just add the right amount of dirt to the lower corner or dig out the right amount from the higher one, or some combination of those, to make their elevations equal. Then the tile border will say that the slope is level. Obviously if all the tile borders say they are level, the tile is level.
If you drop dirt in a place where it would try to raise a corner on a mine opening, the dirt is simply lost. This is a problem when there's a mine opening downhill from some land you're raising.
Bedrock, that eternal foe of city planning, is somewhere roughly around 50 dirts under unmodified ground. If you hit bedrock on all four corners of a tile it exposes the rock face, allowing you to prospect and open a mine entrance.
Clay can't have its elevation lowered, it simply gives you clay if you dig, without changing the elevation. You can put dirt on top and raise the elevation, and dig on that spot to remove the dirt later, but you can't go below the original clay's depth.
Marshes can be dug out and give dirt, but they cannot reach bedrock. Even if you get four corners down to rock it will remain a marsh tile and you will be unable to prospect or open a mine.
You can dig around trees without cutting them down by standing on the corner you want to dig and clicking on a dirt tile connected to it, even if there are trees in the other 3 tiles.
You can drop dirt to use later without adding it back to the terrain by creating an "item pile" with different dropped items, placing the dirt in the item pile container, then removing the other items.