An audio out to your soundcard including the headphone connector will work. You only need a cable that fits into headphone on one end and sound card on other.
As for a recording program here is the most amazing recording tool I've ever seen. You can download a free trial to used it. Use is limited but reinstalling program allows you to "Test it again"
I bought the thing ten years ago 32 bit and when buying a 64 bit system they gave me a free upgrade. Upgrades are free for lifetime.
I recorded a 1960's LP into the program. The filtering properties are so good at removing pops, tics, hum and hiss the resulting CD sounded like a brand new digital recording. It cost about 50$ but if you like to play with
audio this program is top shelf.
You can also add ambiance making your recording sound "Live" "Studio" etc there are hundreds of options. You can even record backwards. Check it out. After ten years I would not be without this thing well worth the money.
I've recorded hundreds of old albums and tapes with unbelievable results.
Goldwave