Connecting a +12V DC wire to a Voltage Regulator with 4 pinouts
The "+" connections connect to the positive rail of each respective power connection, and the "-" connects to the corresponding ground rail. So the positive connection of the 12V supply connects to the + input and its ground to the - input, and the + output supplies 5V and the - output its corresponding ground.

There is no need to connect the two grounds together unless you need to transmit signals between the 12V side and the 5V side.