Start with the top side of the octagon. Draw two lines down from the ends of the top side, each line should be S(1 + 2^0.5) long, where S is the length of the top side. The S part of the expression matches the top, bottom and sides of the octagon. The 2^0.5S is really S/2^0.5 + S/2^0.5 to represent the sides of two triangles whose hypotheses are S. By the Pythagorean theorem (S/2^0.5)^2 + (S/2^0.5)^2 = S^2. Mark two dots on each of these parallel lines.
At this point, you should have the top of the octagon and two parallel lines perpendicular to the top of the pentagon. The one end of each parallel line should be at the ends of the top of the octagon.The dots should be a distance of S/2^05 from the ends of the lines. If you connect the ends of the parallel lines that are opposite to the top of the octagon, you will have the bottom of the octagon.
Draw a horizontal set of parallel lines of the same lengths through the vertical parallel lines and through the dots on the vertical lines. The horizontal set of parallel lines are centered on the vertical lines, making a figure that should be reminiscent of a tic-tac-toe board. The middle square of the tic-tac-toe figure should be S X S. The parts of the parallel lines that extend past the S X S square should each be S/2^0.5 in length.
Connect the ends of the horizontal parallel lines to make the left and right sides of the octagons. Connect the corners of the top and bottom sides with the corners of the left and right sides to complete the edges of the octagon. These last four sides should all be a 45 degrees to parallel lines; all of them should have length S. Erase the interior lines to produce the final version of the octagon.