How to draw an octagon?

The drawing steps of an octagon are as follows:

Draw a square on the plane first. Draw it step by step.

2. Draw a straight line based on the two diagonal points of the square.

3. Draw another square outside the small square so that the four corners are on the diagonal extension of the small square.

4. Make four oblique vertical lines based on the four corners of the small square.

5. The lines needed to connect the regular octagon.

6. Remove excess lines to draw an octagon.