We have analyzed the atomic and molecular gas using the 21 cm HI and 2.6/1.3 mm CO emissions toward the young supernova remnant (SNR) RCW 86 in order to identify the interstellar medium with which the shock waves of the SNR interact. We have found an HI intensity depression in the velocity range between $-46$ and $-28$ km s$^{-1}$ toward the SNR, suggesting a cavity in the interstellar medium. The HI cavity coincides with the thermal and non-thermal emitting X-ray shell. The thermal X-rays are coincident with the edge of the HI distribution, which indicates a strong density gradient, while the non-thermal X-rays are found toward the less dense, inner part of the HI cavity. The most significant non-thermal X-rays are seen toward the southwestern part of the shell where the HI gas traces the dense and cold component. We also identified CO clouds which are likely interacting with the SNR shock waves in the same velocity range as the HI, although the CO clouds are distributed only in a limited part of the SNR shell. The most massive cloud is located in the southeastern part of the shell, showing detailed correspondence with the thermal X-rays. These CO clouds show an enhanced CO $J$ = 2-1/1-0 intensity ratio, suggesting heating/compression by the shock front. We interpret that the shock-cloud interaction enhances non-thermal X-rays in the southwest and the thermal X-rays are emitted by the shock-heated gas of density 10-100 cm$^{-3}$. Moreover, we can clearly see an HI envelope around the CO cloud, suggesting that the progenitor had a weaker wind than the massive progenitor of the core-collapse SNR RX J1713.7$-$3949. It seems likely that the progenitor of RCW 86 was a system consisting of a white dwarf and a low-mass star with low-velocity accretion winds.