If you react quickly following the steps below, you may be able to save the phone. Most phone warranty does not cover water damage.
Step 1:Must avoid most common mistakes
Most common mistake: Don't try to switch on/off phone to see if its working or not as that may cause a short circuit.
Avoid heat exposure: Don't expose the phone to direct sunlight as most phones get damaged due to excessive heat.
Avoid: Must not use microwave to dry phone.
Step 2: RemoveBattery
Remove battery immediately. For iPhones/smartphones... skip to step 4.
Check liquid damage sticker near battery: If a white square/circle turns reddish in color, it indicates water damage.
Step 3: SIM
If you have a GSM phone, remove SIM card. You should be able to retrieve most of your contacts stored on the SIM as SIM cards usually survive water damage.
If having CDMA phone, skip to next step.
Step 4: Drying
Wipe the water gently using a paper or soft towel.
You may use vacuum hose about 3 inches away from your phone for drying.
If your phone gets soaked in salted/sea water, wash the entire phone gently with fresh distilled (not tap) water first and then dry it off.
You may use alcohol to clean/disinfect the external phone area. Do not use alcohol inside the phone as it usually damages the sensitive circuitry.
Step 5: Remove Moisture
Make it moisture free: Remove the phone cover and put the phone completely in a bag of uncooked dry rice or 'desiccant gel packs' for about 10 hours as rice would absorb any remaining moisture. Do not charge the device during this time.