It happens to everyone (or almost everyone). Your phone/tablet gets submerged, or a significant amount of water lands on it. There are water proof phones and cases, but you don’t have one…
Turn it off ASAP!
Don’t argue. Don’t think. Just do it as fast as you can. You don’t want anything to short out.
Open the battery compartment. Take out the battery and SIM card. Mop up whatever water/fluid you can get to (use a Q-tip for any tiny recesses). That means ports, speakers and microphones. Wrap it in a lint free towel until you can get home to do step three.
Put it in a sealed container with a bunch of dry silica gel packets (they come in shoes, and in some beef jerky packages also with electronic stuff you might still have the boxes for). They can also be obtained (ahead of need) from Amazon and Staples. If they’ve been lying around in unsealed containers, heat them in a microwave or with a hair drier BEFORE putting them in with the phone/tablet to dry them out, even if they don’t seem wet.
Leave the phone/tablet in the sealed container with the silica gel packets for no less than 72 hours. Deal with your withdrawal however you must…but 72 hours means just that. If you have the urge to pray, it can’t hurt but I can’t say it’ll help.
Good luck…this isn’t a guarantee, just the best method available. Forget rice, etc. DO NOT use a hair drier on the phone/tablet.
Another scenario? Buy a water proof cover.
By the way, all the phone manufacturers put immersion tabs in their phones, so if you don't have insurance that covers that...