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.
One of the forum moderators
AC 28 USA and earlier • macOS Sonoma 14.7.1, MacBook Pro M2 Max 12CPU/30GPU cores, 32GB