Lay a garden hose on the ground next to the sidewalk. Position the garden hose to mark what you want to be the edge of the flagstone border.
Work your way along the hose, pushing a shovel into the ground. Remove the dirt between the marked edge and the sidewalk's edge, digging down 3 to 4 inches. Lay a level on the ground occasionally to check that the area is not sloping. Tamp down the soil with a hand tamper.
Lay edging along the edge opposite the sidewalk. Hold the edging tight against the side of the dug-out area. Insert a metal spike into each loop on the edging's backside. Use a hammer to pound the spike into the ground to hold the edging in place.
Lay strips of landscape fabric over the dug out area. Cut the landscape fabric to the appropriate length with a scissors. Overlap pieces of landscape fabric by 3 inches.
Pour pea gravel into the dug out area. Use a metal rake to spread the pea gravel out into an even 2-inch layer. Use a hand tamper to tamp the pea gravel down.
Set the flagstone on the pea gravel. Wiggle it around to sink it slightly into the gravel. Hold a level on the flagstone to check that it rests flat in the walkway. Position more flagstone on the pea gravel. The spacing between the flagstone depends on what type of look you want. You can space the flagstones out or lay them close together.
Pour sand onto the flagstones and sweep it into the cracks between flagstones using a broom. Use a garden hose with a spray nozzle attached to moisten the sand, sinking it down slightly, and allow it to dry. Pour more sand onto the flagstone and sweep it into the cracks. Continue until the sand level is even with the flagstones' surface.