After you've plugged everything in, go into Garageband, then go to Garageband-Preferences-Audio/Midi. In the Audio input drop-down, select built-in input.
It should be working now. To record tracks, go to Track-New Track, and then select 'Real Instrument'. From there, you get a selection of effects and amp simulations for different live instruments. After you've selected, if you want to hear yourself whilst you're playing, select 'On' in the Monitor drop-down in the bottom right.