The image shows to lines with a gap between them.
To make two or more lines be a single polyline, select them all and use the Edit > Reshape > Unify command.
If you want to unify the lines shown with the gap, you have to either stretch (mouse commands) or extend (keyboard and mouse click) one line to touch the other, then you can apply the unify command.
AC 28 USA and earlier • macOS Sequoia 15.2, MacBook Pro M2 Max 12CPU/30GPU cores, 32GB
One of the forum moderators