Hi Permanganat,
Welcome to Apple Support Communities. We understand that you'd like to connect your electric guitar to your MacBook Air to use with GarageBand. We'd like to help.
From this resource, it looks like you'll be able to get this done. Check out the steps below to determine which method works best for you:
Connect an electric guitar to your computer
In GarageBand on Mac, do one of the following:
* Connect an audio interface to your computer’s USB or FireWire port, then connect an electric guitar to the audio interface.

* Connect the electric guitar to a channel on the audio interface or the adapter cable, using a standard 1/4-inch tip-sleeve instrument cable.

* If your computer has an audio input port, connect an electric guitar to the audio input port using an adapter cable. Choose Built-in Input as the track’s input source.

If you connect an electric instrument to an audio interface, check the manufacturer’s specifications to make sure the interface is compatible with macOS and Core Audio. Follow the manufacturer’s instructions, which might include installing the correct driver on your computer.
Connecting an electric guitar to your computer’s audio input port may result in a low-level input signal. To increase the input signal, you can connect the guitar to a preamplifier, and connect the preamplifier to your computer.
You can then find additional information of using this connection here: Connect an electric guitar to use with GarageBand on Mac - Apple Support
Hope that helps.
Cheers!