Dwarves stuck underground?

Solution 1:

There are two simple ways. One is to dig an upward staircase just below the surface and a downward staircase on the surface tile above.

Surface ---\---
Layer 1 ___X###

Where -- is the ground, X is the upward staircase, \ is the downward staircase, # is filled and _ is your tunnel. You need to dig the upward staircase first, or just designate both at the same time and your dwarves will dig the proper one first.

The second way is easier. Just dig out a ramp on the level below the ground. Ramps automatically clear the floor from the tile above them. The only tricky bit is that ramps need to have solid ground under one of their sides, like so

Surface ----- ----
Layer 1 _____/####

Where the symbols have similar meanings as before with / as the ramp. If you don't have that filled tile on one side of the ramp then dwarves cannot exit the top of the ramp on that side. So you need to remember to have a filled tile with open ground above it on at least one of the adjacent tiles to the ramp. Just to be safe make it two or three.

On a related note, channeling should leave a ramp behind, so if your miners are stuck it is probably because you either removed the ramp, or dug out under all the adjacent tiles. This is a common mistake to make because the exact nature of ramps is a touch complicated. The wiki has a pretty good explanation with much better pictures than I do. It also has some explanation about stairs with a good diagram of how each tile is divided into floor and wall sections.

Solution 2:

I often start on flat maps, it's really comfortable to play on them in comparison with mountainous maps where it's hard to follow your dwarfs and other entities along the map.

One tile actually consists of a floor and the space above it. A downward stairway essentially just penetrates the floor. A upward stairway goes from the floor to the ceiling of that tile. So to dig down i always start with a downward staircase to penetrate the floor. You see the tiles beneath it get visible when the downward stair has been build. Here (on the visible blocks under the downward stairway) you can place a upward staircase or a up/down staircase if you want the stairs to go deeper.

Beware that staircases do not let caravans get passed. So you need to have a trade depot on top or designate a ramps to the floor you want your depot to build.

Side view with designation symbols:

..j..
..i..
..i..
..u..

This is a staircase with on top a downward stairs the middle 2 a up/down stairs and on the bottom a upstairs. If your up/down or down stairs penetrates a cavern flying creatures will get trough.