They use an ELF or VLF radio using a towed array. wich can penetrate water.
There is also a cool comms method called quantum key distribution for sub to aircraft comms. This method used light. I know this is out of scope for this question. I just thought I would throw that out there.
Subs also raise antennas from the mast while submerged.
Unfortunately, this is how they are spotted by P3’s who call out a feather in the water. Then a destroyer shoots an ASROC and its all over.
It’s healthier for bubbleheads to just stay submerged, and keep quiet…that’s where we like them.