Analogue

Headphone out to line in.

Y-cableThis is a very cheap solution, a Y-cable will do the job.
Probably not the best way as you might have a mismatch between the two in signal level. Be careful with the volume control.
Sound quality probably moderate.
This is excellent to start with, you can try your hand on computer based audio without getting your feet wet.

 

Sound card line out to line in.

Blue Jeans CableThe sound card does the digital to analogue conversion (DAC) and amplification to line level. A standard audio cable with RCA connectors will do the job. Sound quality depends on the quality of the sound card.

The name "RCA" derives from the Radio Corporation of America, which introduced the design by the early 1940s to allow mono phonograph players to be connected to amplifiers.

XLR

Balanced connections are the prosumer standard for decades.
The whole trick is the sender puts the signal on one lead and the inverse on the other. The receiver checks the two signals and removes any differences between the two.
This is the way to go if you run long cables in a electromagnetically noisy environment.

More en more consumer products feature balanced connections.
A lot of these products are single ended by design so you need a balun to create balanced output. Likewise at the receiver you need a differential amp or a transformer.
You might ask your self if adding a balun, a differential amp or a transformer to the signal path is a improvement in sound quality.

Cat5

Long RCA cables are not recommended
XLR (balanced) can be used for long cable runs but most home audio is RCA
Here you find some products allowing balanced audio over CAT5 up to 2500 ft.