Let's take water (and air) as an example.
Sound is a vibration that typically propagates as an audible wave of pressure, through a transmission medium (air and water in you example).
At the QM level, the vibrational energies of the water molecules could be interpreted as heat (temperature).
Molecules, such as oxygen (O2), have more degrees of freedom than single spherical atoms: they undergo rotational and vibrational motions as well as translations. Heating results in an increase in temperature due to an increase in the average translational kinetic energy of the molecules. Heating will also cause, through equipartitioning, the energy associated with vibrational and rotational modes to increase.
Now sound waves do carry energy, and that energy is transferred in part to the water.
Ultrasound is often said to be able to boil water. The reason is, soundwaves do carry energy as they pass through air, and then this soundwave passes into the water, and the energy carried by the wave itself will in part transform into the vibrational energies of the water molecules (heat).
In physics, attenuation or, in some contexts, extinction is the gradual loss of flux intensity through a medium. For instance, dark glasses attenuate sunlight, lead attenuates X-rays, and water and air attenuate both light and sound at variable attenuation rates.
Attenuation is what we call when the soundwave loses energy and that energy is transferred into the medium's (in your case water) molecules' vibrational energies (heat).
Please see here:
When the sound wave hits the boundary of the media (air and water in your case), three things can happen:
elastic scattering (reflection or transmission)
inelastic scattering (heat)
When the sound wave hits the new medium, all three happens. It is the difference in the ration of these three, that is important, because most of the soundwave gets elastically scattered, that is either reflected or transmitted. Now much lesser ratio of the soundwaves gets inelastically scattered, meaning, the waves' energy is in part transferred into the vibrational energies of the water molecules. Another little ratio of the waves gets absorbed by the surface, transferring energy into the vibrational energies of the surface molecules, heating up the surface of the water.
As you go into the water, all three happen again, but inside the water, the ratio is different. Most of the waves get transmitted (elastically scattered), very little get absorbed or inelastically scattered, and none gets reflected.