Hello!
It has been recommended that an iPhone submerged in water should me leaned against the wall, at a 45° angle, charging port downwards. Also, if possible, have a fan set to a low speed blow air on it. This will allow the ports to drain all water they’ve stored, and the airflow will also help dry everything out.
Note: No matter what you read online, DO NOT PLACE YOUR iPHONE IN RICE!
Water damage is mostly unrepairable. After a day or two of letting the iPhone dry, turn it on, and check things over. If it seems to be working fine, excellent! But if you have any issue with it, please take it in to a technician for examination:
I hope this is helpful. Good Luck!