First, don't get it wet on purpose. Apple's warranty still doesn't cover water damage, and there's always a chance the phone could take in liquid. Yes, Apple will know if water was the cause of death. Buried inside the phone is a liquid contact indicator - a small sticker that changes colors if it comes into contact with water.
If it does get damp, unplug any cables and do not attempt to charge it or plug anything into the Lightning connector for at least five hours. You want the phone to be completely dry before introducing electricity. Refrain from opening the SIM tray as well, since that can give water a way into the inner workings of your iPhone.
To dry the device, wipe off the outside with a soft cloth. Stand it up and gently tap it on your hand to shake out any water that's pooled inside the Lightning port. Do not try and dry the port by probing it with a wadded up bit of paper or a Q-tip.
Next, leave it out someplace with good airflow. Don't try and speed up the process with a hair dryer. Placing it in rice won't make the process go faster, and the grain can actually damage the port. A cool fan pointed at the Lightning port is ok, but beyond that it's just a matter of patience.
The device is rated iP67, so it's built to keep out both dust and water. The 6 refers to its level of dust protection and means the phone is totally protected from dust. The 7 is how waterproof it is, out of a possible rating of 8. Be especially careful around salt water, which is more corrosive and can cause much more damage than freshwater.