First of all, get it out of the water, fast. It does take time for moisture to seep into even a non-waterproof phone, and the quicker you get it out of the water the better.
Next, make sure the device is powered all the way off. If you use a model with a removable battery, yank the battery—it would be just as well not to have it in there while drying anyway; the dampness could lead to corrosion. Unplug any accessories, and pop it out of any covers or cases you have on it. (Don’t worry about the screen protector, unless you see a water bubble under it.) If it’s a model where the back comes off (to access the battery, SIM cards, etc.) then pop off the back, too.
Wipe the device down with an absorbent cloth to remove any excess water on the outside. Use a Q-tip to get into tiny ports and jacks. Get it as dry as you can.
Finally, put it in a box filled with silica gel packets, if you were smart enough to save them from boxes of electronics, shoes, and other things they come in. If you don’t have any, use dry rice. (Wrap your device in a paper towel first to make sure you don’t end up with mushy rice in crevices or ports.) Make sure the device is completely covered. If you popped the battery out, throw it in separately, too. Seal the phone and the gel packets or rice in a ziplock bag or a tightly-sealed jar so it’s airtight, then leave it somewhere for 36 to 48 hours. (You can also get pre-made phone-drying products like the Bheestie bag.)
At the end of that time, check it again and see if there’s any residual moisture. If so, put it back in for a while longer. If not, take it out and power it on—and cross your fingers that it still works!
No matter how well you dry your device out, moisture can still do serious damage—so the best solution is not to drop it in the water in the first place. Remember to use a ziplock bag for reading in the tub or on the beach!