Mark two parallel outlines for the sidewalk over your yard or garden in the desired shape using lengths of rope or powdered chalk. Keep at least 3 feet to accommodate two people, or wider to provide passage for a wheelchair. Check that the width of the outlines run even throughout the span of the sidewalk.
Push an edger or the tip of a shovel into the turf along the outer edges of the rope or chalk to mark the lines on the ground. Remove the ropes and set them aside.
Remove the vegetation and dirt within the parallel marks to a depth of 4 inches using a trenching shovel. Pile stones, weeds and plant debris that resurface during the digging process in a tarp and discard. Check that the depth of the trench is uniform with a level, and add or remove dirt for low or high spots as needed.
Compact the soil at the base of the trench using a hand tamper or use a plate compactor for a large sidewalk. Run over the area two to three times to completely firm the soil.
Install lengths of plastic edging against the walls of the trench to contain the gravel and keep it from spreading. Pound the spikes into the holes along the lower ends of the edging to anchor them securely to the ground and prevent them from shifting during freeze-thaw cycles.
Lay agricultural fabric over the base of the excavation to prevent weeds or grasses from growing over the gravel sidewalk. Position the fabric with its shiny side facing upward. Cut excess length along the sides with scissors.
Pour pea gravel into the covered trench, keeping it 1/4- to 1/2-inch lower than the surrounding soil level. Spread the gravel evenly over the trench using a garden rake.