Depends - if you have enough coconuts you just drink the coconut water until rescued. If there is anything else edible on the island you eat that, water from plants will help.
The second option is capturing rainwater, assuming you're in a place with rain.
Third is boiling water to get rid of the salt(you need to capture the steam on a piece of cloth, wring it into another container, but it's probably going to be the fastest option).
Of course this is assuming you have any materials from your ship, which I assume these guys did? You'd at least need a metal pot or a metal sheet that you can bend into the right shape.
But yeah in general without access to at least some kind of container where you can boil water(maybe a rock of a right size would work?) you'd be generally screwed.
I think the final desperate option is to just try and dig down and hope you hit water and that it's not salty.