Those strange silica gel packets that come with shoes, luggage, electronics, and even food are good for more than freshness.
Those tiny packets with the warnings about not eating them are intended to remove excess moisture that could damage certain products. Knowing that its main function is absorbing moisture, there are all kind of uses for these mysterious parcels—including reviving your phone after an impromptu swim.
If you happen to get your phone wet, put it in a plastic bag and completely cover the front and back of your phone with the silica gel packets. Give them 24 hours to work their magic, and you'll hopefully have a functioning phone again.
It's important to mention that this is not a solution for all waterlogged phones. Chances are, if it went for a swim in the sink or—gasp—the toilet for more than a few seconds, you're out of luck. But it's still worth a try.