Drive one 2-by-2 wooden stake 12 inches long into the ground about six inches at each corner of your proposed bed. Tie mason's twine between the stakes to create the outline of your bed. Measure along the twine and drive one stake into the ground along the twine every 4 feet.
Lay your timbers up against the stakes along the outside edge of the outline. Butt the pieces up to each other, if more than one is needed on any one side. Mark the last piece to length and cut it off with a circular saw.
Stand 2-by timbers on edge, or lay thicker timbers flat and set a level along the top of each piece. Use a spade to remove dirt under your timbers to adjust the level, if needed, until the bubble is centered in the indicator.
Align the timbers so that they are on edge, or laying on their faces and up against the wooden stakes. Double check that all corners are overlapped to contain bedding material and create neat joints. Trim any pieces that need it.
With a 1/8-inch pilot bit with countersink, drill two holes through every stake, from the side opposite the timbers you are attaching to them. Drill holes in both directions through corner stakes so that both timbers will be secured at the corner. Start one hole one inch down from the top of the stake and the second two inches below the first.
Drive three-inch treated deck screws through the stakes into the timbers to hold them upright and in line with each other. If you are using 2-by lumber for edging, drive screws through the overlapping timbers into the ends of the overlapped timbers at the corners.