They make patch cords with:
3.5mm stereo plug to 3.5mm stereo plug
3.5mm stereo plug to two RCA plugs
Plug (male) and jack (female) at the respective ends.
(Less common but also available are the same cables with non-stereo plugs.)
The stereo plug has three metal parts in the prong, called tip, ring, and sleeve. You'll probably quickly recognize this on your headphone cord plug. The non-stereo plug has two metal parts in the prong.
The 3.5mm plug is also called a 1/8" plug or a mini-phone plug.
There is also a less common 2.5mm plug which may be called a 3/32" plug or mcro-plug and that is also used for headphones, more commonly non-stereo earplugs on cheap pocket radios.
Be careful not to connect both ends of a cable to jacks labeled headphones or output (line output).
Surround sound connections using one cable use optical cables rather than 3.5mm plugs or RCA plugs.