Remove the deteriorated expansion joints with a pry bar. Chip out old caulk from the sides with a cold chisel and hammer and sweep out debris with a firm wire brush.
Examine the spacing of any expansion joints that run between the end of the sidewalk and other structures like a garage or driveway. If the joints measure less than 1/4 inch, widen the joint to prevent damage to the slabs. Snap a chalk line parallel to the joint that's spaced so the distance between the line and outside edge of the joint measures 1/4 to 1/2 inch wide.
Use a concrete saw to cut a slow, straight line along the chalk. Chisel out loose pieces of concrete and sweep the widened joint with a wire brush.
Measure a strip of foam backer rod to fit the length of each expansion joint you’re replacing, and cut it to fit with a utility knife.
Push each strip into the joint with your hand until it resists, and force it down the rest of the way to the bottom of the joint with a putty knife.
Fill a caulk gun with a tube of expansion joint sealer, and fill the remaining gap in each joint until the sealer sits just above the pavement. Cut off excess with the flat end of a putty knife. If you want the joints to have a recessed finish, run a hand-held jointer tool over each joint before the sealer hardens.