To change the input and output source within Garageband, go to Garageband>Preferences> Then ensure that the relevant devices are in use. In this case, the Scarlett 2i2 has been chosen as the input/output device.
To select or change which channel records into Garageband, create a new track and a dialogue box will appear. Select either “Real Instrument” or “Electric Guitar” based on what you are recording. You can choose input/output, which at this stage should be your interface.
Then by clicking the dropdown box “mono 1” (highlighted) you will be able to select the relevant input.
Alternatively, if you are using a Real Instrument track you can change I/O settings by clicking the Master Track (top right corner) and then changing the options in the bottom right corner (highlighted)