Your UX2 is an audio interface, a device that allows audio input to, and out from, your computer. It has 6 ports for audio input into the computer, though only two of these can be used at a time. On the front there are two XLR inputs, and two ¼” electric guitar/bass inputs. (The pad input is lowered 10 dB for instruments with a hot, or amplified output.) On the back there are two line inputs (mono left and right) for devices with line level output such as synthesizers or turntables.
To designate what inputs your computer will use (as only two are used at a time), you must open System Preferences, click the Line 6 Audio MIDI Devices, and go to inputs & recording.
From here you can specify which two stereo record sends you wish to use from the UX2. In GarageBand, add a new track with the + symbol, and select Real Instrument or Electric Guitar to get an audio track.
Your input source corresponds with the settings in System Preferences.
Want to learn more? Take a training class or a one-on-one peer training session on these topics and more at http://learningcenter.berklee.edu