When I record my guitar plugged into line in, it always gets mixed up with every sound my computer plays while recording.
Example: I listen to a song, then i want to start recording while the song is still playing.
Although my guitar is connected to my computer through the line in I can hear the song I listened to on the recording and my guitar.

What can I do?

what hardware are you using?

Epi Les Paul Std w/Duncans
Cry Baby From Hell
Marshall JH-1
EHX Metal Muff
MXR EVH Phase 90
Carl Martin Classic Chorus
EHX #1 Echo
Ibanez LU-20
Dunlop DCB-10
Crate V50112
Tascam US144

That's your settings.

Whatever your computer's output is, is probably being taken by an input or somert.

I was using all manner of adapters and my computer's default soundcard for recording on the cheap, and got the same issue.

I bought a new USB interface, and that solved just about every problem i have.