Connecting TRS/XLR
Pin 1 ground
Pin 2 hot
Pin 3 cold
Tip is hot
Ring is cold
Sleeve is ground
Pin 2 goes to the Tip
Pin 3 goes to the Ring
Pin 1 goes to the Sleeve.

Connecting a balanced to an unbalanced line:

An unbalanced connector has only a hot and a ground:
(XLR to a regular guitar plug as an example but any combination, balanced to unbalanced, will work the same)

Pin 2 goes to tip, and pins 1 and 3 are tied together and go to the ground. This will make any unbalanced connection compatible with a balanced connection.