Excavate the area for the walk. Dig about 8 inches deep, down to solid soil until all the soil is of the same type. Avoid installations where soil partially is clay and partially is sandy, and avoid roots that may have grown under the walk or any organic matter that may decay under the sidewalk. Bring in good fill dirt or use engineered soil designed for compacting in areas with tree roots if the ground in the area is unstable or unsuitable.
Firmly compact the base dirt with a hand or mechanical tamper. Get the base dirt firm enough so when you step on it, your foot does not leave an impression.
Smooth the dirt so it is fairly level across the whole space of the sidewalk.
Add a base of medium gravel, about 4 inches thick for a 4-inch-thick sidewalk. Smooth the gravel and compact it into a firm solid base without big depressions or gaps in it.
Mix the concrete according to the manufacturer's directions.
Pour the concrete into sidewalk forms and solidly push the concrete into all areas until the concrete fills all the gaps and has no holes.
Use a rake or board to tamp down the concrete into the forms. Let the concrete properly cure. Cover it with a tarpaulin or mist it with water for a couple of days. Concrete does not reach its full strength for at least a week.
Make footing piers if the soil sub-base cannot be solidified. Dig holes with a posthole digger, spaced through the area of the sidewalk. Pour concrete into those holes and let it cure, then pour the main sidewalk on top of the piers. The piers act as footings to minimize the effects of soil compacting or shifting at different rates.
Try "mudjacking" if a sidewalk slab begins to settle too much. This technique injects a thin slurry of cement and fine gravel under the sidewalk through a small hole bored in the slab. The pressure of pumping this mixture into any void under the slab forces it to rise. Once it is level, the pumping stops and the slurry is allowed to congeal.