Rainsford panics only briefly, and then comes to his senses and assesses the situation.
Rainsford was admittedly foolish when he allowed himself to fall overboard inspecting the sound he heard from the island. However, it does not get the best of him for long.
Desperately he struck out with strong strokes after the receding lights of the yacht, but he stopped before he had swum fifty feet. A certain coolheadedness had come to him; it was not the first time he had been in a tight place.
Rainsford realizes that he cannot reach the yacht by swimming, and that no one is likely to hear him as it races off. He saves his energy for heading toward the island, because he knows that he has a better chance there. The ship is moving, the island is not.
As a hunter, Rainsford is a pretty worldly guy. He has been around the block a few times, and likely has been in difficult situations more times than he can count. He probably has been in a similar situation before, and he uses a combination of his instincts and intellect to get himself out of it. It is this skill that will keep him alive when he finds himself faced to face with the island’s inhabitant.