Join one net to another.
If you moved a net segment to join another, you will be asked if you want to merge one net with the other, changing the name.
If you extended one net to join another, you will be asked if you want to connect the net segments, and if so, which net name to use.
Respond to the question in the dialog to complete the optimization.