How to straighten lines with multiple segments?

When drawing a line how do I straighten the lines horizontally and vertically? Using shift is only helpful when it is a line with just one segment. If I’ve to draw a line that has multiple segments (bending at right angles) the shift trick does not seem to help… any pointers would be greatly appreciated…

Greetings. You can use Arrange > Align to help straighten lines. Aligning connected objects often helps straighten the connecting lines.

Thanks, but that’s only when the two objects are connected by a line with no segments. In other words, consider two squares connected by an L-shaped line. How can I make sure that the two parts of the line L are straight — one horizontal and the other vertical?